From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C720C433E2 for ; Thu, 3 Sep 2020 07:24:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3051E20737 for ; Thu, 3 Sep 2020 07:24:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3051E20737 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9D9EA6B0037; Thu, 3 Sep 2020 03:24:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 989EA6B0055; Thu, 3 Sep 2020 03:24:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87A006B0068; Thu, 3 Sep 2020 03:24:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0082.hostedemail.com [216.40.44.82]) by kanga.kvack.org (Postfix) with ESMTP id 735DE6B0037 for ; Thu, 3 Sep 2020 03:24:53 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3B34B1E0B for ; Thu, 3 Sep 2020 07:24:53 +0000 (UTC) X-FDA: 77220913266.30.metal82_50076bd270a7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 0BD1A180B3AA7 for ; Thu, 3 Sep 2020 07:24:53 +0000 (UTC) X-HE-Tag: metal82_50076bd270a7 X-Filterd-Recvd-Size: 2551 Received: from outbound-smtp63.blacknight.com (outbound-smtp63.blacknight.com [46.22.136.252]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Thu, 3 Sep 2020 07:24:52 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp63.blacknight.com (Postfix) with ESMTPS id 59BBBFA79C for ; Thu, 3 Sep 2020 08:24:50 +0100 (IST) Received: (qmail 6364 invoked from network); 3 Sep 2020 07:24:49 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.21.127]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 3 Sep 2020 07:24:49 -0000 Date: Thu, 3 Sep 2020 08:24:47 +0100 From: Mel Gorman To: Alex Shi Cc: Anshuman Khandual , David Hildenbrand , Matthew Wilcox , Vlastimil Babka , Alexander Duyck , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/4] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags Message-ID: <20200903072447.GB3179@techsingularity.net> References: <1599116482-7410-1-git-send-email-alex.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1599116482-7410-1-git-send-email-alex.shi@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 0BD1A180B3AA7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 03, 2020 at 03:01:20PM +0800, Alex Shi wrote: > pageblock_flags is used as long, since every pageblock_flags is just 4 > bits, 'long' size will include 8(32bit machine) or 16 pageblocks' flags, > that flag setting has to sync in cmpxchg with 7 or 15 other pageblock > flags. It would cause long waiting for sync. > > If we could change the pageblock_flags variable as char, we could use > char size cmpxchg, which just sync up with 2 pageblock flags. it could > relief the false sharing in cmpxchg. > > Signed-off-by: Alex Shi Page block types were not known to change at high frequency that would cause a measurable performance drop. If anything, the performance hit from pageblocks is the lookup paths which is a lot more frequent. What was the workload you were running that altered pageblocks at a high enough frequency for collisions to occur when updating adjacent pageblocks? -- Mel Gorman SUSE Labs