Skip to contentSkip to conversation

+ mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Oct 3, 2013

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: + mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 03 Oct 2013 15:02:34 -0700

The patch titled

     Subject: mm/vmscan.c: don't forget to free shrinker->nr_deferred

has been added to the -mm tree. Its filename is
mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Andrew Vagin <[email protected]>
Subject: mm/vmscan.c: don't forget to free shrinker->nr_deferred

This leak was added by 1d3d4437eae ("vmscan: per-node deferred work").

unreferenced object 0xffff88006ada3bd0 (size 8):
comm "criu", pid 14781, jiffies 4295238251 (age 105.641s) hex dump (first 8 bytes):

    00 00 00 00 00 00 00 00                          ........
  backtrace:
    [<ffffffff8170caee>] kmemleak_alloc+0x5e/0xc0
    [<ffffffff811c0527>] __kmalloc+0x247/0x310
    [<ffffffff8117848c>] register_shrinker+0x3c/0xa0
    [<ffffffff811e115b>] sget+0x5ab/0x670
    [<ffffffff812532f4>] proc_mount+0x54/0x170
    [<ffffffff811e1893>] mount_fs+0x43/0x1b0
    [<ffffffff81202dd2>] vfs_kern_mount+0x72/0x110
    [<ffffffff81202e89>] kern_mount_data+0x19/0x30
    [<ffffffff812530a0>] pid_ns_prepare_proc+0x20/0x40
    [<ffffffff81083c56>] alloc_pid+0x466/0x4a0
    [<ffffffff8105aeda>] copy_process+0xc6a/0x1860
    [<ffffffff8105beab>] do_fork+0x8b/0x370
    [<ffffffff8105c1a6>] SyS_clone+0x16/0x20
    [<ffffffff8171f739>] stub_clone+0x69/0x90
    [<ffffffffffffffff>] 0xffffffffffffffff
Cc Mel Gorman <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Glauber Costa <[email protected]>

---

 mm/vmscan.c |    2 ++
 1 file changed, 2 insertions(+)
mm/vmscan.c renamed from mm/vmscan.c~mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred +2 -0
diff -puN mm/vmscan.c~mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred mm/vmscan.c
@@ -211,6 +211,8 @@ void unregister_shrinker(struct shrinker
 	down_write(&shrinker_rwsem);
 	list_del(&shrinker->list);
 	up_write(&shrinker_rwsem);
+
+	kfree(shrinker->nr_deferred);
 }
 EXPORT_SYMBOL(unregister_shrinker);
 

_

Patches currently in -mm which might be from [email protected] are

mm-vmscanc-dont-forget-to-free-shrinker-nr_deferred.patch