summaryrefslogtreecommitdiffstats
path: root/Documentation/kmemleak.txt
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-04-03 17:46:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:20:50 -0400
commitc89da70c7360294e715df5abd4b7239db3274c86 (patch)
treeb7b8107c361f84f5ca2a27f1a2c6542e60154630 /Documentation/kmemleak.txt
parentdc9b3f424903f7d6992778b69b1e35d864914ae5 (diff)
kmemleak: allow freeing internal objects after kmemleak was disabled
Currently if kmemleak is disabled, the kmemleak objects can never be freed, no matter if it's disabled by a user or due to fatal errors. Those objects can be a big waste of memory. OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME 1200264 1197433 99% 0.30K 46164 26 369312K kmemleak_object With this patch, after kmemleak was disabled you can reclaim memory with: # echo clear > /sys/kernel/debug/kmemleak Also inform users about this with a printk. Signed-off-by: Li Zefan <lizefan@huawei.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/kmemleak.txt')
-rw-r--r--Documentation/kmemleak.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/Documentation/kmemleak.txt b/Documentation/kmemleak.txt
index b6e39739a36d..6c18be97f3dd 100644
--- a/Documentation/kmemleak.txt
+++ b/Documentation/kmemleak.txt
@@ -53,7 +53,8 @@ Memory scanning parameters can be modified at run-time by writing to the
53 (default 600, 0 to stop the automatic scanning) 53 (default 600, 0 to stop the automatic scanning)
54 scan - trigger a memory scan 54 scan - trigger a memory scan
55 clear - clear list of current memory leak suspects, done by 55 clear - clear list of current memory leak suspects, done by
56 marking all current reported unreferenced objects grey 56 marking all current reported unreferenced objects grey,
57 or free all kmemleak objects if kmemleak has been disabled.
57 dump=<addr> - dump information about the object found at <addr> 58 dump=<addr> - dump information about the object found at <addr>
58 59
59Kmemleak can also be disabled at boot-time by passing "kmemleak=off" on 60Kmemleak can also be disabled at boot-time by passing "kmemleak=off" on
@@ -120,6 +121,18 @@ Then as usual to get your report with:
120 121
121 # cat /sys/kernel/debug/kmemleak 122 # cat /sys/kernel/debug/kmemleak
122 123
124Freeing kmemleak internal objects
125---------------------------------
126
127To allow access to previosuly found memory leaks after kmemleak has been
128disabled by the user or due to an fatal error, internal kmemleak objects
129won't be freed when kmemleak is disabled, and those objects may occupy
130a large part of physical memory.
131
132In this situation, you may reclaim memory with:
133
134 # echo clear > /sys/kernel/debug/kmemleak
135
123Kmemleak API 136Kmemleak API
124------------ 137------------
125 138