From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752761AbcFLHjG (ORCPT ); Sun, 12 Jun 2016 03:39:06 -0400 Received: from out4133-18.mail.aliyun.com ([42.120.133.18]:25050 "EHLO out4133-18.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbcFLHjE (ORCPT ); Sun, 12 Jun 2016 03:39:04 -0400 X-Greylist: delayed 319 seconds by postgrey-1.27 at vger.kernel.org; Sun, 12 Jun 2016 03:39:03 EDT X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03296;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_----4uwXqGI_1465716805; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Mel Gorman'" Cc: "linux-kernel" , References: <02ed01d1c47a$49fbfbc0$ddf3f340$@alibaba-inc.com> In-Reply-To: <02ed01d1c47a$49fbfbc0$ddf3f340$@alibaba-inc.com> Subject: Re: [PATCH 04/27] mm, vmscan: Begin reclaiming pages on a per-node basis Date: Sun, 12 Jun 2016 15:33:25 +0800 Message-ID: <02f101d1c47c$b4bae0f0$1e30a2d0$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQID4Bd5mSpcvpPA/8zC/MgbOSogT5+BNHAA Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -3207,15 +3228,14 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > sc.may_writepage = 1; > > /* > - * Now scan the zone in the dma->highmem direction, stopping > - * at the last zone which needs scanning. > - * > - * We do this because the page allocator works in the opposite > - * direction. This prevents the page allocator from allocating > - * pages behind kswapd's direction of progress, which would > - * cause too much scanning of the lower zones. > + * Continue scanning in the highmem->dma direction stopping at > + * the last zone which needs scanning. This may reclaim lowmem > + * pages that are not necessary for zone balancing but it > + * preserves LRU ordering. It is assumed that the bulk of > + * allocation requests can use arbitrary zones with the > + * possible exception of big highmem:lowmem configurations. > */ > - for (i = 0; i <= end_zone; i++) { > + for (i = end_zone; i >= end_zone; i--) { s/i >= end_zone;/i >= 0;/ ? > struct zone *zone = pgdat->node_zones + i; > > if (!populated_zone(zone))