Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3529636iob; Sat, 7 May 2022 07:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLJAUiGGfiK/NqmCMSNS2kLltgkl7NsMlhzCtiOJUim3OjoeJvw9SuXjmd7vRY5+nXTUGx X-Received: by 2002:a17:906:794e:b0:6f5:2072:b00a with SMTP id l14-20020a170906794e00b006f52072b00amr7115004ejo.277.1651933668890; Sat, 07 May 2022 07:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651933668; cv=none; d=google.com; s=arc-20160816; b=EvNFaQh54T5TzuISKhPQGS6DLBhToXwL+wvMXjfN6Yf7bjLyk8KOGpmeCRZxuOk7ZG dgo1zrpWAjB26gNjSd1hIFBRBpo0SVGj7LD30/1XBNl8qBal2txmhlKBR7V6qJa1cZeX ydzhnTapv5Dop1oNHYEvcLZgzepzjar7M+j2JM+GHXmMeS49LdTT8m92h/GECyXlBYb9 KzRSduZ1s6cuMpqmbbFu5KOQlFXTmmIGuJgihwyf0ioIboJUllY4L8FLX7kp9GANYgh7 5AEoPCNmF/YPLeoNzWhBYVHC1nLN2wMo87tLVXK+GUzp1n0TmEFW0wX9/7k3Gi9rzp3M x3Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5hY41osTb+rs/5K7Bs0M1F/6D+5OAUASLpzavXr/PdQ=; b=DXLFi8YpB33PSU5Fx0rLxcuplQLuvCwm/dqSQyKGQQ2GikehMqDZ+MbqO8nbR4956C ta4yqWvYUrU2OGzugrot/ka2DVf5rj6SEZatoWWVBvVNKa5UZA6gPD52uTNVDnwGaRBg rPyQXLUtmFeSfV1OM4xYqOYnGCSy/JiaaPpU0EQQ+o04eM3rBRvHBDms6fJ3PkgVXhah Fw1XxutP5F+F0ee2BQSUp+tErOlxvKJ0o11lSYf1t2z98pw0z7MpfvtBcPngS8MZzHM2 YW2uVFMpFlh6vMNu1izrI35Fxexn6vTvbpQAcsrYy0vRJTwpBfXgeylw0sOAlOp/yrES hagA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020a17090610c700b006f38847f5c0si7997710ejv.694.2022.05.07.07.27.21; Sat, 07 May 2022 07:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354084AbiEELNg (ORCPT + 99 others); Thu, 5 May 2022 07:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344317AbiEELNe (ORCPT ); Thu, 5 May 2022 07:13:34 -0400 Received: from outbound-smtp42.blacknight.com (outbound-smtp42.blacknight.com [46.22.139.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C596E13D28 for ; Thu, 5 May 2022 04:09:52 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp42.blacknight.com (Postfix) with ESMTPS id 095B917A7 for ; Thu, 5 May 2022 12:09:51 +0100 (IST) Received: (qmail 10219 invoked from network); 5 May 2022 11:09:50 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 5 May 2022 11:09:50 -0000 Date: Thu, 5 May 2022 12:09:47 +0100 From: Mel Gorman To: Aaron Lu Cc: kernel test robot , Linus Torvalds , Vlastimil Babka , Dave Hansen , Jesper Dangaard Brouer , Michal Hocko , Andrew Morton , LKML , lkp@lists.01.org, lkp@intel.com, ying.huang@intel.com, feng.tang@intel.com, zhengjun.xing@linux.intel.com, fengwei.yin@intel.com Subject: Re: [mm/page_alloc] f26b3fa046: netperf.Throughput_Mbps -18.0% regression Message-ID: <20220505110947.GD3441@techsingularity.net> References: <20220420013526.GB14333@xsang-OptiPlex-9020> <20220429133918.GC3441@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 05, 2022 at 04:27:04PM +0800, Aaron Lu wrote: > On Fri, Apr 29, 2022 at 02:39:18PM +0100, Mel Gorman wrote: > > On Fri, Apr 29, 2022 at 07:29:19PM +0800, Aaron Lu wrote: > > ... ... > > > > The said change looks like this: > > > (relevant comment will have to be adjusted) > > > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > > index 505d59f7d4fa..130a02af8321 100644 > > > --- a/mm/page_alloc.c > > > +++ b/mm/page_alloc.c > > > @@ -3332,18 +3332,19 @@ static int nr_pcp_high(struct per_cpu_pages *pcp, struct zone *zone, > > > bool free_high) > > > { > > > int high = READ_ONCE(pcp->high); > > > + int batch = READ_ONCE(pcp->batch); > > > > > > - if (unlikely(!high || free_high)) > > > + if (unlikely(!high)) > > > return 0; > > > > > > - if (!test_bit(ZONE_RECLAIM_ACTIVE, &zone->flags)) > > > - return high; > > > - > > > /* > > > * If reclaim is active, limit the number of pages that can be > > > * stored on pcp lists > > > */ > > > - return min(READ_ONCE(pcp->batch) << 2, high); > > > + if (test_bit(ZONE_RECLAIM_ACTIVE, &zone->flags) || free_high) > > > + return min(batch << 2, high); > > > + > > > + return high; > > > } > > > > > > static void free_unref_page_commit(struct page *page, int migratetype, > > > > > > Does this look sane? If so, I can prepare a formal patch with proper > > > comment and changelog, thanks. > > > > I think it looks reasonable sane. The corner case is that if > > ((high - (batch >> 2)) > cachesize) that the pages will not get recycled > > When free_high is true, the above diff changed the return value of > nr_pcp_high() from 0 to min(batch << 2, pcp->high) so the corner case is > when (min(batch << 2, pcp->high) > cachesize)? > Yes. It's not perfect due to cache aliasing so the actual point where it matters will be variable. Whatever the value is, there a value where the corner case applies that pages do not get recycled quickly enough and are no longer cache-hot. -- Mel Gorman SUSE Labs