Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2175952pxa; Mon, 17 Aug 2020 03:01:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB1yC0V7GKPJtamQ9rwpVitJHT5Do2u5EsukE2FMgDPtDWyx5fEhd9NkmjM0M4pISQaVPJ X-Received: by 2002:a17:906:8389:: with SMTP id p9mr14888267ejx.391.1597658515020; Mon, 17 Aug 2020 03:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597658515; cv=none; d=google.com; s=arc-20160816; b=uYOL0RpnxfS1g3wZNmwrVoeTGsKdaOoCZoxwEaVOCpcyEyEFfO2ay6x0U+AegNovFI D0UlT0cuN2sR6fCgDwG6bYA1Tzmll+x7jew3cSSHYMi6iknEa1N422BvC1zedfAtDgcQ 7gRz06YP89VCRWuvps9BMjIXJsOtSBv5CGVrYbRTh6nNLhdElZKTxyK0e4mlTslCPbE+ ZaNiffcj2VBZJAx7nb11+Qcux6TRJFOVeGdggsByOZAWmXkHVq/+Tal1MNQJMaP+3SoJ JbI/n8LPxQgkNZjU+cU50/FXAN1sdknZJNtgc2Gs1lCdSJjoRuRJgKB/Jh5FX+L/M1YD 2GAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date; bh=lx9lN1HntLavAVEBR7Ha1ZbsTDc9NeYWBgd2hCpdOac=; b=q1ucDmptsEnMuAm8jussE5tSLsmJTwVbdyP8qzrsEpikR/xtPnBKtX8sc35Og/27Cu IZChZwrCGLtPfAYTcO7uetnEpbKgObRVuxq0MJjtC9gsPEAxjgaP9vaT2AP/linhBSwU Sf02z10pP2wgaceSzncg2DqpZm7weOopEMZCxJALiQ4ioeH9x2osDih/VtjxlTVpMDot MjfMsRZORdZf+6hMx9aqR3tD54f9QhX2Qe0vAZp6eePAohh4R3FTr8DCK7WVYAiX74YN 7RcQEHCYKwGlenUE1+Du3JS2+Asf877VyQ0OoUoOpJI1B0lv7cAkHd9rIUlX+fq8p37d M4yg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si10935392ejb.350.2020.08.17.03.01.32; Mon, 17 Aug 2020 03:01:55 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgHQJ60 (ORCPT + 99 others); Mon, 17 Aug 2020 05:58:26 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:36239 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbgHQJ6Y (ORCPT ); Mon, 17 Aug 2020 05:58:24 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U6.NLKV_1597658301; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U6.NLKV_1597658301) by smtp.aliyun-inc.com(127.0.0.1); Mon, 17 Aug 2020 17:58:22 +0800 Date: Mon, 17 Aug 2020 17:58:21 +0800 From: Wei Yang To: Alex Shi Cc: Andrew Morton , Hugh Dickins , Alexander Duyck , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags Message-ID: <20200817095821.GA29756@L-31X9LVDL-1304.local> Reply-To: Wei Yang References: <1597549677-7480-1-git-send-email-alex.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1597549677-7480-1-git-send-email-alex.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 16, 2020 at 11:47:56AM +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 much false sharing in cmpxchg. > If my understanding is correct, CPU reads data in the size of cacheline. Define a variable a char or other, doesn't help on false sharing. Correct me, if not. -- Wei Yang Help you, Help me