summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2011-05-23 10:02:19 +0200
committerJens Axboe <jaxboe@fusionio.com>2011-05-23 10:02:19 +0200
commit2abae55f5a41d29f21b5b259c33d218c950d5c90 (patch)
tree69169fa89fb25fcf7521999d7fca91664262bfc7
parent345227d705f2318e9bc088e79fe71a38bb5fe82b (diff)
downloadop-kernel-dev-2abae55f5a41d29f21b5b259c33d218c950d5c90.zip
op-kernel-dev-2abae55f5a41d29f21b5b259c33d218c950d5c90.tar.gz
cfq-iosched: Fix a memory leak of per cpu stats for root group
We allocated per cpu stats struct for root group but did not free it. Fix it. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--block/cfq-iosched.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d646b27..0316f6e 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -3940,6 +3940,11 @@ static void cfq_exit_queue(struct elevator_queue *e)
*/
if (wait)
synchronize_rcu();
+
+#ifdef CONFIG_CFQ_GROUP_IOSCHED
+ /* Free up per cpu stats for root group */
+ free_percpu(cfqd->root_group.blkg.stats_cpu);
+#endif
kfree(cfqd);
}
OpenPOWER on IntegriCloud