From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932682AbcGEG6b (ORCPT ); Tue, 5 Jul 2016 02:58:31 -0400 Received: from out4133-18.mail.aliyun.com ([42.120.133.18]:14183 "EHLO out4133-18.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751004AbcGEG63 (ORCPT ); Tue, 5 Jul 2016 02:58:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R751e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03291;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_----5-SzI5y_1467701858; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "Mel Gorman" Cc: "linux-kernel" , , "Andrew Morton" References: <00e101d1d689$b9a1d730$2ce58590$@alibaba-inc.com> In-Reply-To: <00e101d1d689$b9a1d730$2ce58590$@alibaba-inc.com> Subject: Re: [PATCH 21/31] mm, page_alloc: Wake kswapd based on the highest eligible zone Date: Tue, 05 Jul 2016 14:57:38 +0800 Message-ID: <00e201d1d68a$84b72100$8e256300$@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: AQINSuvLCvninpiD5eCtaESg/QcsfJ+SfaXA Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > The ac_classzone_idx is used as the basis for waking kswapd and that is based > on the preferred zoneref. If the preferred zoneref's highest zone is lower > than what is available on other nodes, it's possible that kswapd is woken > on a zone with only higher, but still eligible, zones. As classzone_idx > is strictly adhered to now, it causes a problem because eligible pages > are skipped. > > For example, node 0 has only DMA32 and node 1 has only NORMAL. An allocating > context running on node 0 may wake kswapd on node 1 telling it to skip > all NORMAL pages. > > Signed-off-by: Mel Gorman > --- Acked-by: Hillf Danton > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 2fe2fbb4f2ad..b10bee2e5968 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3415,7 +3415,7 @@ static void wake_all_kswapds(unsigned int order, const struct alloc_context *ac) > for_each_zone_zonelist_nodemask(zone, z, ac->zonelist, > ac->high_zoneidx, ac->nodemask) { > if (last_pgdat != zone->zone_pgdat) > - wakeup_kswapd(zone, order, ac_classzone_idx(ac)); > + wakeup_kswapd(zone, order, ac->high_zoneidx); > last_pgdat = zone->zone_pgdat; > } > } > -- > 2.6.4