Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1889136pxk; Tue, 1 Sep 2020 10:05:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys2sCcD9sPKlD3ruhzjtXNuSLxA+8nEXN2iNuouS6glyvsq6a0VmhR0I+MOyCQ2FKNoXip X-Received: by 2002:a17:906:e218:: with SMTP id gf24mr2527149ejb.469.1598979950449; Tue, 01 Sep 2020 10:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598979950; cv=none; d=google.com; s=arc-20160816; b=ACybk10N0BkBYI+KtiiTx0JR4Vu4x3PbLY0WDtueTbsx8FKm3Mwyhf48dKTtZivyDf al15FR4uChGTBifjAdJodl8qK+Q44MKCM8833MBvyPUBRNqEl1XH/Sfh3jlbwGzRe6XY 3SMIQ6i7lbe0OW4J9Kn1xBp+ZPkIp/FxwVmTrsQ+MwdvsEm9JmCp40Ca6n9DOD4otPAP 249XoOQkr6n9L6yX7AV1EwdROdjgki90GEa5reUh6EIM03ydAiEEDyyowv0MIoxJ8SB2 xZqI5T5K+TqD5vEbIWTdMaEpntu6KFAn9PXqfgfV6IePa1bk1dOVoxOnjWAn+06CF/sC 96rw== 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; bh=Fr1O5NMJJ1gZhetZRC+wUuVNJ2hOH8z8dYs4T5L7BP4=; b=k1WR5UuArw/Upl2498VXxfTgbjsp3WqSaC4TVnioiMcTquBBwAMYnRecg6OxXrH3PF WScB+58cfvByzVGsCz0oVT4szC+bVw1HCVO+zsf26OjU1l9L1R5mPqOFwIFGKM7kdeVz dTgdVG6iA11TKcsmqI93dz2bDLV5yNK9qN01NPW8NnL2FEzdQwIMIkvUQ26MQjUp9G9U BnCUO9K6JyIS3QMo1dPqvVb4HHDg+aZ4kDnYbRbozboAjZJReHWv2VpxIMOGAsKnVQaO uT3jxXgvkbW0jm4/QLHhO21qP1qz21K8xTDMRvT23lw3KwOIEo9W5i5cG4rT7Kl9yiRo J5mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si984386eje.2.2020.09.01.10.05.26; Tue, 01 Sep 2020 10:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbgIAREY (ORCPT + 99 others); Tue, 1 Sep 2020 13:04:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:46224 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726984AbgIAREN (ORCPT ); Tue, 1 Sep 2020 13:04:13 -0400 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/19/20 10:09 AM, Alex Shi wrote: > > > 在 2020/8/19 下午3:57, Anshuman Khandual 写道: >> >> >> On 08/19/2020 11:17 AM, Alex Shi wrote: >>> Current pageblock_flags is only 4 bits, so it has to share a char size >>> 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 128MB >>> on x86, 4 chars in 1 GB. >> >> Agreed that increase in memory utilization is negligible here but does >> this really improve performance ? >> > > It's no doubt in theory. and it would had a bad impact according to > commit e380bebe4771548 mm, compaction: keep migration source private to a single 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 protected 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. > > BTW, I naturally hate the false sharing even it's in theory. Anyone who doesn't? :) > > Thanks > Alex >