83dbbdbb38
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 <w.landgraf@ru.ru> Cc: stable@vger.kernel.org Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Colin Cross <ccross@android.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
android | ||
asus_oled | ||
bcm | ||
comedi | ||
cptm1217 | ||
crystalhd | ||
cxt1e1 | ||
echo | ||
et131x | ||
frontier | ||
ft1000 | ||
iio | ||
keucr | ||
line6 | ||
media | ||
mei | ||
nvec | ||
octeon | ||
olpc_dcon | ||
omapdrm | ||
ozwpan | ||
panel | ||
phison | ||
quatech_usb2 | ||
quickstart | ||
ramster | ||
rtl8187se | ||
rtl8192e | ||
rtl8192u | ||
rtl8712 | ||
rts5139 | ||
rts_pstor | ||
sbe-2t3e3 | ||
sep | ||
serial | ||
serqt_usb2 | ||
slicoss | ||
sm7xx | ||
speakup | ||
ste_rmi4 | ||
telephony | ||
tidspbridge | ||
usbip | ||
vme | ||
vt6655 | ||
vt6656 | ||
winbond | ||
wlags49_h2 | ||
wlags49_h25 | ||
wlan-ng | ||
xgifb | ||
zcache | ||
zram | ||
zsmalloc | ||
Kconfig | ||
Makefile | ||
staging.c |