Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3256651pxj; Mon, 24 May 2021 02:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNJGhCaY1NHHvtsrUWChyNnDUaO69g9S1HjUb4Mk/pGpATeT1pnggMqHFGG039t68KmDRv X-Received: by 2002:a17:906:e096:: with SMTP id gh22mr22542241ejb.101.1621848228842; Mon, 24 May 2021 02:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621848228; cv=none; d=google.com; s=arc-20160816; b=gM8CyrGh93qhS71gPn6tY0YEjS4JPhZxEQGK22Jj6hHw2IxVQGcM+qe/fqcfZbTXjk NdX3AcH3R53WMFP7G+MHfWGuFiVsQRc2awK5AKdHiGRt3jQnviUdlq7rF7gOY5jBWHnz ahbb6EkkTr+2x2/vrM6NV6ehHcMmbKP5GPsQPKZqiJjNFkWQHZ/NTgi96SMbWi+lGaEN TX2KOYoyeT7JJnuG56kfgs2EXEiCzDCwHtvwEo78XFnbtckc37cVcqvq9wfWTCcNE0pV LH9ZCXh6lDJWV/H06L482EEFATTaCYPHXn5ZLsY/Lv+mNeEYZjPW+CP76o1LqEnJbhQv Uvzw== 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=lUwh8JfTHva0AkAqHDAjfUzENEijjHAgDxtrqhnjsJ0=; b=AwKDTbxhaISvJVZL6nDIguBbg2AFnRTJQzCzSDMfjRdjUSL8IFqKRVJWXY9NGTWlTF G2BiwlIE4yJR4hd+chK4nxapR+YR/Urn4ekmzPGt2Y7ShHp4ryRMBUOSsR3RLwF2BXl5 QJ0f+Lt2ZOARoP1zorgvazBfRvmpfLw58pa4fVQ9g24+rEP++hFfrJkFK60a6e6yQ94S RJer12E5Iawv1UEKO24OWrP/Ej1VANpQ9mgr1Jm3bOaMIHMUT0u3SmJhqt49qsZskoEq aLC/Ybp3fmpu9ccjrzq/R5AV2CWrRJ5HWELsTdzpOD5lj5/WgZ4fY/9cfLit4zf1WWQc B84w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb9si14734777ejb.411.2021.05.24.02.23.25; Mon, 24 May 2021 02:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbhEXJX5 (ORCPT + 99 others); Mon, 24 May 2021 05:23:57 -0400 Received: from outbound-smtp46.blacknight.com ([46.22.136.58]:44845 "EHLO outbound-smtp46.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbhEXJX4 (ORCPT ); Mon, 24 May 2021 05:23:56 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp46.blacknight.com (Postfix) with ESMTPS id D8990FA898 for ; Mon, 24 May 2021 10:22:27 +0100 (IST) Received: (qmail 22945 invoked from network); 24 May 2021 09:22:27 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.23.168]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 24 May 2021 09:22:27 -0000 Date: Mon, 24 May 2021 10:22:25 +0100 From: Mel Gorman To: Dave Hansen Cc: Linux-MM , Dave Hansen , Matthew Wilcox , Vlastimil Babka , Michal Hocko , Nicholas Piggin , LKML Subject: Re: [PATCH 5/6] mm/page_alloc: Limit the number of pages on PCP lists when reclaim is active Message-ID: <20210524092225.GD30378@techsingularity.net> References: <20210521102826.28552-1-mgorman@techsingularity.net> <20210521102826.28552-6-mgorman@techsingularity.net> <3f0ebd90-1aca-1dfc-3b92-bdb991d0fb29@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <3f0ebd90-1aca-1dfc-3b92-bdb991d0fb29@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 03:44:49PM -0700, Dave Hansen wrote: > On 5/21/21 3:28 AM, Mel Gorman wrote: > > +static int nr_pcp_high(struct per_cpu_pages *pcp, struct zone *zone) > > +{ > > + int high = READ_ONCE(pcp->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 READ_ONCE(pcp->batch) << 2; > > +} > > Should there be a sanity check on this? Let's say we had one of those > weirdo zones with tons of CPUs and a small low_wmark_pages(). Could we > have a case where: > > pcp->high < pcp->batch<<2 > > and this effectively *raises* nr_pcp_high()? > > It's not possible with the current pcp->high calculation, but does > anything prevent it now? I don't think it would happen as pcp->batch is reduced for small zones but a sanity check does not hurt so I added one. -- Mel Gorman SUSE Labs