Received: by 10.223.185.116 with SMTP id b49csp4239096wrg; Mon, 26 Feb 2018 13:50:19 -0800 (PST) X-Google-Smtp-Source: AH8x225CyFotPxenLTsHxuALp9mdytR0kGGoFYgSrF92ynZjCIEo3l2BkZ9DeSmx2rdGqxTryRCT X-Received: by 10.99.148.17 with SMTP id m17mr9529500pge.367.1519681819193; Mon, 26 Feb 2018 13:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519681819; cv=none; d=google.com; s=arc-20160816; b=FxwhBTcc4Bb04gJDeVSkbUG+WEhCzfMKynBcqjkoP8kNMOHP6CQEXCA0Nu0UqXj5kJ pniAVtciQ721z561PCPexdhKcq5HsdJSXdcCj4OiZbBSugYxAQYjEQgiSsXMNroYRDVx J2L3LPcha8PSc8MrfXvAFPktm91pgN91kB3lNU1eT84Hp0Pe1ZFqG4pkhgbQgMtSEvP4 je4krq7Zu3tr/buRwIvPeJ7caEXbI9Undd8gxzL/iAO0mPabLin7BOOJdWq8+G1CT02l E01r5nTQNEfjF6V1HUlSrFuiyld7kCciF0hN/vgMGXPLtVI7ihjELlVzIYNCgUG8wQMD Bd2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=rhyrZRaDLGy3IBtToZgYoToj9PB5lDgbjy3pI8BptWI=; b=KSSuaVEISwSOqg8MvuDIu9xAl/8y89i9lvzoOg5w+o14R4lj4tDEeYg+riUtDc1Kge n/1p5Z3NeXHWQqntQv3zlvJjOq3B1hrhd/wDUtcZiFv05HIPci1CLYuBlxpNihr8H8X7 Zjt+JhbEXONJoqL1F5Q0Wa8ShAQ9jpQUu8XIG1cOiMso6G67PohQdlt9anReNcfkOtD0 iLAk5MhnMqnjEjNjhCfKQOqbH0POx+GimvUtW6qTDeZsb9mvjLbAeznwP4vF/kOJ0qZb HRL6wJSEiXS7ZManz1tJX8OtlwMThQuybJf17CjbyAGjlEzKI4fzQpStecHo3WffCeMu ChMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CFo2VgGy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si6026771pgv.514.2018.02.26.13.50.03; Mon, 26 Feb 2018 13:50:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CFo2VgGy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbeBZVsV (ORCPT + 99 others); Mon, 26 Feb 2018 16:48:21 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:38010 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbeBZVsR (ORCPT ); Mon, 26 Feb 2018 16:48:17 -0500 Received: by mail-io0-f195.google.com with SMTP id g21so18888531ioj.5 for ; Mon, 26 Feb 2018 13:48:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=rhyrZRaDLGy3IBtToZgYoToj9PB5lDgbjy3pI8BptWI=; b=CFo2VgGy3xoCbedLiLKl9lRfhFPPdmJvtIIAQ9ri8m3vlGXY8LSi1WzpyBHR0o4G2W NJa1aWvxxY/3q2vwu2Iit6V1/bkgCotyBCw639QJaMlGkXFRN0TDVxdgzx+oRTF59jwy ZJzJzDJOBjDM12K8yMyhCCl2LLTI+91NiOv5HJM0flnzw6JmIT7qubTh89mDCwkrhcRY uSOPo+ZcT7am35rRCTK7sYNeW8tbYRFP81NSBU78aLpR1PFLXXbgknyOcpu2w0JueCxw bo36u1k4N53zb/HfUgS4lbd2jwxdNX4e3R+EnU06IDLVwdvX9GfIbNiJ6ezoZO5EJ7dq G1gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=rhyrZRaDLGy3IBtToZgYoToj9PB5lDgbjy3pI8BptWI=; b=hmpqe8MNmg2W6jo5WD84iV+Zr83cRu4usbpcGurAtTjidGcE2EyyVI/XQAsXd248rF MksYl4LcSq353+CcnEcNXGKumT5jdefkumWBwLm04aIVZf/DYtfHxdfwPzHssSgo6hdO nWDgLJFwd2SFHWV+8DfBzKXLDCeizMEne7MuBuCuxXu2HpCE7EjQeGRzqna82iRXcP2x s7JBIElBGWtRUBiMx8skSjpWprS2TdxDc8Hm1aS9fnXre4cPT6K5FgksS0evFPMINeN+ 9jQeJAj8mjDookCxpZB5swdjTtmKYtzhQwY6zBWSmba14UAzhjRP+Z97Pckt5UMW6J8/ BWZw== X-Gm-Message-State: APf1xPBcPe4FnPQ+NlyqY9CXDWyTNljdHNU6yTJuz7nd0FV4j+jIuNdT 0yEZ2XaHuEM307lLX5tOH0OlTzYUCBM= X-Received: by 10.107.183.65 with SMTP id h62mr13622369iof.278.1519681696172; Mon, 26 Feb 2018 13:48:16 -0800 (PST) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id l16sm6103228iti.36.2018.02.26.13.48.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 13:48:15 -0800 (PST) Date: Mon, 26 Feb 2018 13:48:14 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Aaron Lu cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Huang Ying , Dave Hansen , Kemi Wang , Tim Chen , Andi Kleen , Michal Hocko , Vlastimil Babka , Mel Gorman , Matthew Wilcox Subject: Re: [PATCH v3 1/3] mm/free_pcppages_bulk: update pcp->count inside In-Reply-To: <20180226135346.7208-2-aaron.lu@intel.com> Message-ID: References: <20180226135346.7208-1-aaron.lu@intel.com> <20180226135346.7208-2-aaron.lu@intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Feb 2018, Aaron Lu wrote: > Matthew Wilcox found that all callers of free_pcppages_bulk() currently > update pcp->count immediately after so it's natural to do it inside > free_pcppages_bulk(). > > No functionality or performance change is expected from this patch. > > Suggested-by: Matthew Wilcox > Signed-off-by: Aaron Lu > --- > mm/page_alloc.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index cb416723538f..3154859cccd6 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1117,6 +1117,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, > int batch_free = 0; > bool isolated_pageblocks; > > + pcp->count -= count; > spin_lock(&zone->lock); > isolated_pageblocks = has_isolate_pageblock(zone); > Why modify pcp->count before the pages have actually been freed? I doubt that it matters too much, but at least /proc/zoneinfo uses zone->lock. I think it should be done after the lock is dropped. Otherwise, looks good.