mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] blkio: Release blkg infrastructure only after last policy is deactivated.
@ 2014-06-23 18:52 shirishpargaonkar
  2014-06-23 18:56 ` Shirish Pargaonkar
  2014-06-24 21:09 ` Tejun Heo
  0 siblings, 2 replies; 7+ messages in thread
From: shirishpargaonkar @ 2014-06-23 18:52 UTC (permalink / raw)
  To: tj; +Cc: linux-kernel, vgoyal, Shirish Pargaonkar

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-04 18:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-23 18:52 [PATCH] blkio: Release blkg infrastructure only after last policy is deactivated shirishpargaonkar
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

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®