summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorPrakash Gupta <guptap@codeaurora.org>2017-04-18 07:32:20 +0530
committerPrakash Gupta <guptap@codeaurora.org>2017-04-18 07:32:31 +0530
commit1b8bb0da0b2dad2cc884580d1b38aab4cca78532 (patch)
treef86b0b7f0f9bff5a091ca6566d01edbd1e483755 /net/unix/af_unix.c
parentd5311c5d4300455a7597b7edae08caba84c0a7f8 (diff)
lowmemorykiller: fix scan_mutex contention
A livelock can be created in the system by lowmemorykiller trying to kill the same task again and again. Below is the livelock condition. P0 -> binder_main_lock(W) P1 -> binder_main_lock(T)-> mmap_sem(W) P2 -> mmap_sem(T) -> lowmem_scan::scan_mutex(W) P3 -> lowmem_scan::scan_mutex(T) -> send SIGKILL P0 Here multiple tasks are contending on scan_mutex, and binder_main_lock. Change lowmem_scan mutex_lock with mutex_trylock, so in case of lowmem_scan lock contention, task will be allowed to reclaim from other shrinkers. This will also maintain the serialization of lowmemorykiller trigger. If a task is pending MEMDIE'ing, remove sleep before falling back on other shrinkers. If the task selected to be killed is MEMDIE'ing and in un-interruptible sleep state, do not repeat kill but fallback on other shrinkers without any delay. Change-Id: I12131622f7fa7b422c6d5d09f782af848300e412 Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions