From: 朱辉 <zhuhui@xiaomi.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "rientjes@google.com" <rientjes@google.com>,
"vinayakm.list@gmail.com" <vinayakm.list@gmail.com>,
"weijie.yang@samsung.com" <weijie.yang@samsung.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"teawater@gmail.com" <teawater@gmail.com>
Subject: Re: [PATCH] Fix the issue that lowmemkiller fell into a cycle that try to kill a task
Date: Tue, 23 Sep 2014 04:48:55 +0000 [thread overview]
Message-ID: <C1476EAB93B413409890F290A20101879D8C96@ex-mbox2> (raw)
In-Reply-To: <20140923041738.GA6779@kroah.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1715 bytes --]
On 09/23/14 12:18, Greg KH wrote:
> On Tue, Sep 23, 2014 at 10:57:09AM +0800, Hui Zhu wrote:
>> 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@xiaomi.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, ¶m);
>
> This seems really specific to a specific scheduler pattern now. Isn't
> there some other way to resolve this?
I tried to let the task that call lowmemkiller sleep some time when it
try to kill same task. But it doesn't work.
I think the issue is that the free memroy size is too low to make more
and more tasks come to call lowmemkiller.
Thanks,
Hui
>
> thanks,
>
> greg k-h
>
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2014-09-23 4:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 2:57 Hui Zhu
2014-09-23 4:17 ` Greg KH
2014-09-23 4:48 ` 朱辉 [this message]
2014-09-23 8:00 ` Weijie Yang
2014-09-23 14:28 ` 朱辉
2014-09-23 22:24 ` David Rientjes
2014-09-24 15:34 ` Rik van Riel
2014-10-14 6:51 ` 朱辉
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C1476EAB93B413409890F290A20101879D8C96@ex-mbox2 \
--to=zhuhui@xiaomi.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rientjes@google.com \
--cc=teawater@gmail.com \
--cc=vinayakm.list@gmail.com \
--cc=weijie.yang@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®