lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 23 Sep 2014 10:57:09 +0800
From:	Hui Zhu <zhuhui@...omi.com>
To:	<gregkh@...uxfoundation.org>, <rientjes@...gle.com>,
	<vinayakm.list@...il.com>, <weijie.yang@...sung.com>
CC:	<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>,
	<teawater@...il.com>, Hui Zhu <zhuhui@...omi.com>
Subject: [PATCH] Fix the issue that lowmemkiller fell into a cycle that try to kill a task

The cause of this issue is when free memroy size is low and a lot of task is
trying to shrink the memory, the task that is killed by lowmemkiller cannot get
CPU to exit itself.

Fix this issue with change the scheduling policy to SCHED_FIFO if a task's flag
is TIF_MEMDIE in lowmemkiller.

Signed-off-by: Hui Zhu <zhuhui@...omi.com>
---
 drivers/staging/android/lowmemorykiller.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
index b545d3d..ca1ffac 100644
--- a/drivers/staging/android/lowmemorykiller.c
+++ b/drivers/staging/android/lowmemorykiller.c
@@ -129,6 +129,10 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
 
 		if (test_tsk_thread_flag(p, TIF_MEMDIE) &&
 		    time_before_eq(jiffies, lowmem_deathpending_timeout)) {
+			struct sched_param param = { .sched_priority = 1 };
+
+			if (p->policy == SCHED_NORMAL)
+				sched_setscheduler(p, SCHED_FIFO, &param);
 			task_unlock(p);
 			rcu_read_unlock();
 			return 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ