Received: by 10.213.65.68 with SMTP id h4csp1048275imn; Wed, 21 Mar 2018 00:56:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELtEKY3yUJujw1MKF8jPm4QgX8AKNR9qB+zihUzIaalhyqk5WgA8zZxkn7M/OgEMKMa4Qpnp X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr19641214pla.328.1521618986258; Wed, 21 Mar 2018 00:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521618986; cv=none; d=google.com; s=arc-20160816; b=KP/XWnGSi2X5OD7UpUtwf6kUpifC+dWBOOIKtZ4jH5xFTD/gi/4Ljg4F3CEl23uQnU +15bA3Bwa/dlmMwPkFF8rpXGjxsAL7Prqsuoa4uTV6FI/PMQjdG7MrqrLtitHK5eJOSv LeOGnfCv/gbnW3Ee7//QA9btFGw+nx9vLZnqoCPhZqVpSQypi07V4YyDcIqbyG48eWJi NTUnjh1D6CexDT6RSSATIzN66djC5ceqYVXgf9VWigHVp6Vdrk+Q1urWDlht01tFM6UB r9A/WdYPYozsfxeg3j2UG1wHyyioKKcCV7oaBQRwNLDIvqpFWzINANt3ZGfeEnNTwO1E CCmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=fSy5Pzb6ArOm8f7m8P5S6cm/5JeCCRsjTr/BgeNjRJY=; b=zi2xSE4GgCKR0yAlj8knyZv4evfh3XaXYJr+8AUcm+2OMW5l5sGiQsC7j+Q9Ij6ASJ qbHG8kAqkTraWuOxxfCaxieofR3oHdLY3Bx6mzCuHqjY93gKpO5vGcOkISQ1Y+ncAMC3 PrAlX8oYxSJ/7rDULQqdIqhha5m2DUgr24sklwdN9LN+2AeeoVKRh+HmusrYK5Z8b9Uq /9MKEUBIFNAyqxWzr5GXeZt1+yjCA7kJozTDIiLvAdiRRknUS1ry7XnG5fEX4F2LWwwE 1dLWLzjxnnCsP0NbyGVSJ1dxq3tGTvQ5rhN5jkC6TFxGZXppvKuI9CWN6KY8neF22iQI xJEQ== 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 x27si2410842pgc.4.2018.03.21.00.56.11; Wed, 21 Mar 2018 00:56:26 -0700 (PDT) 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 S1751541AbeCUHzU (ORCPT + 99 others); Wed, 21 Mar 2018 03:55:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:43184 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbeCUHzT (ORCPT ); Wed, 21 Mar 2018 03:55:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A4D01AD43; Wed, 21 Mar 2018 07:55:17 +0000 (UTC) Subject: Re: [RFC PATCH v2 2/4] mm/__free_one_page: skip merge for order-0 page unless compaction failed 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 , Mel Gorman , Matthew Wilcox , Daniel Jordan References: <20180320085452.24641-1-aaron.lu@intel.com> <20180320085452.24641-3-aaron.lu@intel.com> <7b1988e9-7d50-d55e-7590-20426fb257af@suse.cz> <20180320141101.GB2033@intel.com> From: Vlastimil Babka Message-ID: <5b1f7ef5-0dca-c35f-aba9-3b55f81740b2@suse.cz> Date: Wed, 21 Mar 2018 08:53:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180320141101.GB2033@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/20/2018 03:11 PM, Aaron Lu wrote: > On Tue, Mar 20, 2018 at 12:45:50PM +0100, Vlastimil Babka wrote: >> But why, with all the prefetching in place? > > The prefetch is just for its order 0 buddy, if merge happens, then its > order 1 buddy will also be checked and on and on, so the cache misses > are much more in merge mode. I see. >> Not thrilled about such disruptive change in the name of a >> microbenchmark :/ Shouldn't normally the pcplists hide the overhead? > > Sadly, with the default pcp count, it didn't avoid the lock contention. > We can of course increase pcp->count to a large enough value to avoid > entering buddy and thus avoid zone->lock contention, but that would > require admin to manually change the value on a per-machine per-workload > basis I believe. Well, anyone who really cares about performance has to invest some time to tuning anyway, I believe? >> If not, wouldn't it make more sense to turn zone->lock into a range lock? > > Not familiar with range lock, will need to take a look at it, thanks for > the pointer. The suggestion was rather quick and not well thought-out. Range lock itself is insufficient - for merging/splitting buddies it's ok for working with struct pages because the candidate buddies are within a MAX_ORDER range. But the freelists contain pages from the whole zone. >> >>> A new document file called "struct_page_filed" is added to explain >>> the newly reused field in "struct page". >> >> Sounds rather ad-hoc for a single field, I'd rather document it via >> comments. > > Dave would like to have a document to explain all those "struct page" > fields that are repurposed under different scenarios and this is the > very start of the document :-) Oh, I see. > I probably should have explained the intent of the document more. > > Thanks for taking a look at this. > >>> Suggested-by: Dave Hansen >>> Signed-off-by: Aaron Lu >>> --- >>> Documentation/vm/struct_page_field | 5 +++ >>> include/linux/mm_types.h | 1 + >>> mm/compaction.c | 13 +++++- >>> mm/internal.h | 27 ++++++++++++ >>> mm/page_alloc.c | 89 +++++++++++++++++++++++++++++++++----- >>> 5 files changed, 122 insertions(+), 13 deletions(-) >>> create mode 100644 Documentation/vm/struct_page_field >>>