From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbdAYCYa (ORCPT ); Tue, 24 Jan 2017 21:24:30 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36181 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbdAYCY2 (ORCPT ); Tue, 24 Jan 2017 21:24:28 -0500 Subject: Re: [PATCH RFC 3/3] mm, vmscan: correct prepare_kswapd_sleep return value To: Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1485244144-13487-1-git-send-email-hejianet@gmail.com> <1485244144-13487-4-git-send-email-hejianet@gmail.com> <1485295267.15964.38.camel@redhat.com> Cc: Andrew Morton , Naoya Horiguchi , Michal Hocko , Mike Kravetz , "Aneesh Kumar K.V" , Gerald Schaefer , zhong jiang , "Kirill A. Shutemov" , Vaishali Thakkar , Johannes Weiner , Mel Gorman , Vlastimil Babka , Minchan Kim From: hejianet Message-ID: <1f17d49a-90dc-aa2b-6a3a-6fb5291e318f@gmail.com> Date: Wed, 25 Jan 2017 10:24:08 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485295267.15964.38.camel@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/01/2017 6:01 AM, Rik van Riel wrote: > On Tue, 2017-01-24 at 15:49 +0800, Jia He wrote: >> When there is no reclaimable pages in the zone, even the zone is >> not balanced, we let kswapd go sleeping. That is prepare_kswapd_sleep >> will return true in this case. >> >> Signed-off-by: Jia He >> --- >> mm/vmscan.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/mm/vmscan.c b/mm/vmscan.c >> index 7396a0a..54445e2 100644 >> --- a/mm/vmscan.c >> +++ b/mm/vmscan.c >> @@ -3140,7 +3140,8 @@ static bool prepare_kswapd_sleep(pg_data_t >> *pgdat, int order, int classzone_idx) >> if (!managed_zone(zone)) >> continue; >> >> - if (!zone_balanced(zone, order, classzone_idx)) >> + if (!zone_balanced(zone, order, classzone_idx) >> + && !zone_reclaimable_pages(zone)) >> return false; >> } > > This patch does the opposite of what your changelog > says. The above keeps kswapd running forever if > the zone is not balanced, and there are no reclaimable > pages. sorry for the mistake, I will check what happened. I tested in my local system. B.R. Jia > >