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=-7.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 F1BDBC433E2 for ; Tue, 1 Sep 2020 17:04:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8D0B82071B for ; Tue, 1 Sep 2020 17:04:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8D0B82071B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 24EF06B00B9; Tue, 1 Sep 2020 13:04:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FE606B00BA; Tue, 1 Sep 2020 13:04:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 115E5900018; Tue, 1 Sep 2020 13:04:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id E54B66B00B9 for ; Tue, 1 Sep 2020 13:04:12 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 98D2A3634 for ; Tue, 1 Sep 2020 17:04:12 +0000 (UTC) X-FDA: 77215115544.22.hall38_000bc4d27099 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 6601F18038E6A for ; Tue, 1 Sep 2020 17:04:12 +0000 (UTC) X-HE-Tag: hall38_000bc4d27099 X-Filterd-Recvd-Size: 2899 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Sep 2020 17:04:11 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 02919ACC5; Tue, 1 Sep 2020 17:04:11 +0000 (UTC) Subject: Re: [PATCH v2 2/2] mm/pageblock: remove false sharing in pageblock_flags To: Alex Shi , Anshuman Khandual , Matthew Wilcox , David Hildenbrand Cc: Andrew Morton , Hugh Dickins , Alexander Duyck , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mel Gorman References: <1597816075-61091-1-git-send-email-alex.shi@linux.alibaba.com> <1597816075-61091-2-git-send-email-alex.shi@linux.alibaba.com> <715f1588-9cd5-b845-51a5-ca58549c4d28@arm.com> From: Vlastimil Babka Message-ID: <11d6c4ae-6eae-aef9-5652-73a8680cd6e4@suse.cz> Date: Tue, 1 Sep 2020 19:04:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Rspamd-Queue-Id: 6601F18038E6A X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable 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 8/19/20 10:09 AM, Alex Shi wrote: >=20 >=20 > =E5=9C=A8 2020/8/19 =E4=B8=8B=E5=8D=883:57, Anshuman Khandual =E5=86=99= =E9=81=93: >>=20 >>=20 >> On 08/19/2020 11:17 AM, Alex Shi wrote: >>> Current pageblock_flags is only 4 bits, so it has to share a char siz= e >>> in cmpxchg when get set, the false sharing cause perf drop. >>> >>> If we incrase the bits up to 8, false sharing would gone in cmpxchg. = and >>> the only cost is half char per pageblock, which is half char per 128M= B >>> on x86, 4 chars in 1 GB. >>=20 >> Agreed that increase in memory utilization is negligible here but does >> this really improve performance ? >>=20 >=20 > It's no doubt in theory. and it would had a bad impact according to=20 > commit e380bebe4771548 mm, compaction: keep migration source private t= o a single=20 I don't think that commit is doing the test_and_set_skip() under lock to = avoid false sharing. I think it's done to simply make the test and set protecte= d against races without relying on e.g. a truly atomic test_and_set_bit(). = It's still noted that it's just a hint so it's not protected to others calling set_pageblock_skip() from other contexts not under a lock. > but I do have some problem in running thpscale/mmtest. I'd like to see = if anyone > could give a try. >=20 > BTW, I naturally hate the false sharing even it's in theory. Anyone who= doesn't? :) >=20 > Thanks > Alex=20 >=20