From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755056AbcHaGKd (ORCPT ); Wed, 31 Aug 2016 02:10:33 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55635 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbcHaGK3 (ORCPT ); Wed, 31 Aug 2016 02:10:29 -0400 X-IBM-Helo: d28dlp01.in.ibm.com X-IBM-MailFrom: srikar@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 31 Aug 2016 11:39:59 +0530 From: Srikar Dronamraju To: Mel Gorman Cc: Andrew Morton , Linux-MM , Rik van Riel , Vlastimil Babka , Johannes Weiner , Minchan Kim , Joonsoo Kim , LKML , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, Mahesh Salgaonkar , Hari Bathini Subject: Re: [PATCH 07/34] mm, vmscan: make kswapd reclaim in terms of nodes Reply-To: Srikar Dronamraju References: <1467970510-21195-1-git-send-email-mgorman@techsingularity.net> <1467970510-21195-8-git-send-email-mgorman@techsingularity.net> <20160829093844.GA2592@linux.vnet.ibm.com> <20160830120728.GV8119@techsingularity.net> <20160830142508.GA10514@linux.vnet.ibm.com> <20160830150051.GW8119@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20160830150051.GW8119@techsingularity.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16083106-0056-0000-0000-000002DFE32D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16083106-0057-0000-0000-00000FC566AE Message-Id: <20160831060959.GA6787@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-30_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608310077 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > The trigger is memblock_reserve() for the complete node memory. And > > this is exactly what FA_DUMP does. Here again the node has memory but > > its all reserved so there is no free memory in the node. > > > > Did you mean populated_zone() when you said zone_populated or have I > > mistaken? populated_zone() does return 1 since it checks for > > zone->present_pages. > > > > Yes, I meant populated_zone(). Using present pages may have hidden > a long-lived corner case as it was unexpected that an entire node > would be reserved. The old code happened to survive *probably* because > pgdat_reclaimable would look false and kswapd checks for pgdat being > balanced would happen to do the right thing in this case. > > Can you check if something like this works? > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index d572b78b65e1..cf64a5456cf6 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -830,7 +830,7 @@ unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); > > static inline int populated_zone(struct zone *zone) > { > - return (!!zone->present_pages); > + return (!!zone->managed_pages); > } > > extern int movable_zone; > This indeed fixes the problem. Please add my Tested-by: Srikar Dronamraju