diff options
| author | David Rientjes <[email protected]> | 2012-04-09 23:56:18 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-04-10 03:48:44 +0000 |
| commit | 83dbbdbb38666e20a75fad2294cf1df77c52f121 (patch) | |
| tree | cfed4ddb4468615cec47e086955672b306f8b993 /lib/cpu-notifier-error-inject.c | |
| parent | Linux 3.4-rc2 (diff) | |
| download | kernel-83dbbdbb38666e20a75fad2294cf1df77c52f121.tar.gz kernel-83dbbdbb38666e20a75fad2294cf1df77c52f121.zip | |
android, lowmemorykiller: remove task handoff notifier
The task handoff notifier leaks task_struct since it never gets freed
after the callback returns NOTIFY_OK, which means it is responsible for
doing so.
It turns out the lowmemorykiller actually doesn't need this notifier at
all. It's used to prevent unnecessary killing by waiting for a thread
to exit as a result of lowmem_shrink(), however, it's possible to do
this in the same way the kernel oom killer works by setting TIF_MEMDIE
and avoid killing if we're still waiting for it to exit.
The kernel oom killer will already automatically set TIF_MEMDIE for
threads that are attempting to allocate memory that have a fatal signal.
The thread selected by lowmem_shrink() will have such a signal after the
lowmemorykiller sends it a SIGKILL, so this won't result in an
unnecessary use of memory reserves for the thread to exit.
This has the added benefit that we don't have to rely on
CONFIG_PROFILING to prevent needlessly killing tasks.
Reported-by: Werner Landgraf <[email protected]>
Cc: [email protected]
Signed-off-by: David Rientjes <[email protected]>
Acked-by: Colin Cross <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions
