mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: shirishpargaonkar@gmail.com
To: tj@kernel.org
Cc: linux-kernel@vger.kernel.org, vgoyal@redhat.com,
	Shirish Pargaonkar <spargaonkar@suse.com>
Subject: [PATCH] blkio: Release blkg infrastructure only after last policy is deactivated.
Date: Mon, 23 Jun 2014 13:52:25 -0500	[thread overview]
Message-ID: <1403549545-6535-1-git-send-email-spargaonkar@suse.com> (raw)

From: Shirish Pargaonkar <spargaonkar@suse.com>

Release blkg infrastructure only after last policy is deactivated
(i.e. let blkg_destroy_all() be called only from blkcg_deactivate_policy())

Otherwise, module can oops because root_blkg gets assigned NULL during
cleanup and we attempt draining the service queues via root_blkg afterwords.

Signed-off-by: Shirish Pargaonkar <spargaonkar@suse.com>
Reported-and-tested-by: Sachin Sant <ssant@in.ibm.com>
---
 block/blk-cgroup.c | 15 ---------------
 block/blk-sysfs.c  |  2 +-
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 069bc20..3920de6 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -878,21 +878,6 @@ void blkcg_drain_queue(struct request_queue *q)
 	blk_throtl_drain(q);
 }
 
-/**
- * blkcg_exit_queue - exit and release blkcg part of request_queue
- * @q: request_queue being released
- *
- * Called from blk_release_queue().  Responsible for exiting blkcg part.
- */
-void blkcg_exit_queue(struct request_queue *q)
-{
-	spin_lock_irq(q->queue_lock);
-	blkg_destroy_all(q);
-	spin_unlock_irq(q->queue_lock);
-
-	blk_throtl_exit(q);
-}
-
 /*
  * We cannot support shared io contexts, as we have no mean to support
  * two tasks with the same ioc in two different groups without major rework
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 23321fb..ee24cd2 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -503,7 +503,7 @@ static void blk_release_queue(struct kobject *kobj)
 
 	blk_sync_queue(q);
 
-	blkcg_exit_queue(q);
+	blk_throtl_exit(q);
 
 	if (q->elevator) {
 		spin_lock_irq(q->queue_lock);
-- 
1.8.3.2


             reply	other threads:[~2014-06-23 18:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 18:52 shirishpargaonkar [this message]
2014-06-23 18:56 ` Shirish Pargaonkar
2014-06-24 21:09 ` Tejun Heo
2014-06-24 21:37   ` Shirish Pargaonkar
2014-06-24 21:43     ` Tejun Heo
2014-07-04 17:18       ` Tejun Heo
2014-07-04 18:54         ` Shirish Pargaonkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403549545-6535-1-git-send-email-spargaonkar@suse.com \
    --to=shirishpargaonkar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spargaonkar@suse.com \
    --cc=tj@kernel.org \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®