From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754774AbbCPLoA (ORCPT ); Mon, 16 Mar 2015 07:44:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47755 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753705AbbCPLn4 (ORCPT ); Mon, 16 Mar 2015 07:43:56 -0400 Message-ID: <5506C1F6.1090803@redhat.com> Date: Mon, 16 Mar 2015 07:43:50 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Vaibhav Shinde CC: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Mel Gorman Subject: Re: kswapd hogging in lowmem_shrink References: <5502F9BC.2020001@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/16/2015 03:45 AM, Vaibhav Shinde wrote: > > > On Fri, Mar 13, 2015 at 7:52 AM, Rik van Riel > wrote: >> >> On 03/13/2015 10:25 AM, Vaibhav Shinde wrote: >> > >> > On low memory situation, I see various shrinkers being invoked, but in >> > lowmem_shrink() case, kswapd is found to be hogging for around 150msecs. >> > >> > Due to this my application suffer latency issue, as the cpu was not >> > released by kswapd0. >> > >> > I took below traces with vmscan events, that show lowmem_shrink taking >> > such long time for execution. >> >> This is the Android low memory killer, which kills the >> task with the lowest priority in the system. >> >> The low memory killer will iterate over all the tasks >> in the system to identify the task to kill. >> >> This is not a problem in Android systems, and other >> small systems where this piece of code is used. >> >> What kind of system are you trying to use the low >> memory killer on? >> >> How many tasks are you running? >> > yes, lowmemorykiller kills the task depending on its oom_score, I am > using a embedded device with 2GB memory, there are task running that > cause lowmemory situation - no issue about it. > > But my concern is kswapd takes too long to iterate through all the > processes(lowmem_shrink() => for_each_process()), the time taken is > around 150msec, due to which my high priority application suffer system > latency that cause malfunctioning. If it is an issue for you, you will have to fix that. -- All rights reversed