Received: by 10.223.176.46 with SMTP id f43csp977799wra; Wed, 24 Jan 2018 08:44:22 -0800 (PST) X-Google-Smtp-Source: AH8x226FzW88yLbP/V+djt2uw+V0OFIjnV2+rQWZ36Zw7Hzo6GRPRp7Po+gWwb9lv+kLXNbdsJ0M X-Received: by 2002:a17:902:34f:: with SMTP id 73-v6mr8660009pld.122.1516812262442; Wed, 24 Jan 2018 08:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516812262; cv=none; d=google.com; s=arc-20160816; b=l7V4aoyFniK46mbhjWJF0Vp2XMf+cX23fY1rLabpLFxo52rn0lFxGrQJwmTjWW/UBM dzrn3B2MDphWadPbwOkmQ3TmNDtWvimLuyEUf8Pse6AaI3HLsmX7yqRpuiCdi+h7Tz53 S/ZcY9kr4Q3ZtaI5A6XdaQhhYMf1iKWdxQRAkph1k0JDR4B3hU8aGkStO+LCcf88gzMl uwMqPW39DvV/++I/3qT1pILrQSKWQigUEVAbSvpnpQr7dQ4XF2cE29SNzOFWBV+6Dcwu 57HKLR12Vw+4jUTRvEMcFyMQH3+P5p8blULJ1MoVS91WnlGpOJPsDZA/QyqKDDRqqvb7 8cyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=fdf36hKCohTlpQ0Ix7avtOu7RgmyQtLOhzn2z3AKYvY=; b=UC34QOY0icDlHs47t90PgM5aUO0P7Dl8vMAeXo5DL32N4+hOLvgt5N8px+FBq7CGHZ Xjz162unY0+yCyLUYBhQlqn9XB5HohOlIqDnqlpf/e6tkzNeMbaCo6s32FsIKbIQR5WK JH1kW4bMo743dX0/fytZdYAgoFIDCWGy4aDkQ76pCnXzzsN79AQqFHm14xLbPt978PNn PrViFBYETgcd9LsDFxW+GfxxjMwNpzpxXMJ3Zrt82vb1S7YFrn4Tyma8py4WVBIM4sDz QxUL4M7Tp2pHYBbd/45DllIelcLC43VF+kkyO+lTm8DgrKIIwJMTDGrOk7gUYuK1uRmq K8sA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si333381pgq.537.2018.01.24.08.44.08; Wed, 24 Jan 2018 08:44:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964883AbeAXQnr (ORCPT + 99 others); Wed, 24 Jan 2018 11:43:47 -0500 Received: from outbound-smtp27.blacknight.com ([81.17.249.195]:55362 "EHLO outbound-smtp27.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964790AbeAXQnq (ORCPT ); Wed, 24 Jan 2018 11:43:46 -0500 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp27.blacknight.com (Postfix) with ESMTPS id 7C1ACB90AA for ; Wed, 24 Jan 2018 16:43:45 +0000 (GMT) Received: (qmail 8134 invoked from network); 24 Jan 2018 16:43:45 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.237.61]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 24 Jan 2018 16:43:45 -0000 Date: Wed, 24 Jan 2018 16:43:45 +0000 From: Mel Gorman 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 Subject: Re: [PATCH 2/2] free_pcppages_bulk: prefetch buddy while not holding lock Message-ID: <20180124164344.lca63gjn7mefuiac@techsingularity.net> References: <20180124023050.20097-1-aaron.lu@intel.com> <20180124023050.20097-2-aaron.lu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20180124023050.20097-2-aaron.lu@intel.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 24, 2018 at 10:30:50AM +0800, Aaron Lu wrote: > When a page is freed back to the global pool, its buddy will be checked > to see if it's possible to do a merge. This requires accessing buddy's > page structure and that access could take a long time if it's cache cold. > > This patch adds a prefetch to the to-be-freed page's buddy outside of > zone->lock in hope of accessing buddy's page structure later under > zone->lock will be faster. > > Test with will-it-scale/page_fault1 full load: > > kernel Broadwell(2S) Skylake(2S) Broadwell(4S) Skylake(4S) > v4.15-rc4 9037332 8000124 13642741 15728686 > patch1/2 9608786 +6.3% 8368915 +4.6% 14042169 +2.9% 17433559 +10.8% > this patch 10462292 +8.9% 8602889 +2.8% 14802073 +5.4% 17624575 +1.1% > > Note: this patch's performance improvement percent is against patch1/2. > I'm less convinced by this for a microbenchmark. Prefetch has not been a universal win in the past and we cannot be sure that it's a good idea on all architectures or doesn't have other side-effects such as consuming memory bandwidth for data we don't need or evicting cache hot data for buddy information that is not used. Furthermore, we end up doing some calculations twice without any guarantee that the prefetch can offset the cost. It's not strong enough of an opinion to outright NAK it but I'm not ACKing it either. -- Mel Gorman SUSE Labs