]> git.baikalelectronics.ru Git - kernel.git/commit
kmemleak: don't hang if user disables scanning early
authorVegard Nossum <vegard.nossum@oracle.com>
Thu, 28 Jul 2016 22:48:32 +0000 (15:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jul 2016 23:07:41 +0000 (16:07 -0700)
commit3a03b4f6c8903bdaf74fc864af84dd8ac43b419c
tree37153594a46e04d5cd0a54a8d88d271f88e698b3
parent41ca99a3e232649c4003f0ecc500ab2b6b7dd767
kmemleak: don't hang if user disables scanning early

If the user tries to disable automatic scanning early in the boot
process using e.g.:

  echo scan=off > /sys/kernel/debug/kmemleak

then this command will hang until SECS_FIRST_SCAN (= 60) seconds have
elapsed, even though the system is fully initialised.

We can fix this using interruptible sleep and checking if we're supposed
to stop whenever we wake up (like the rest of the code does).

Link: http://lkml.kernel.org/r/1468835005-2873-1-git-send-email-vegard.nossum@oracle.com
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.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>
mm/kmemleak.c