Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1540683pxa; Sun, 16 Aug 2020 02:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCHg0iCF2lRtyllav8BmRSTe7uxH39UlUGEzwg35iqkeF4CTNcuewyDjA80S+ww5nXl67r X-Received: by 2002:a17:907:9483:: with SMTP id dm3mr10447417ejc.333.1597569205613; Sun, 16 Aug 2020 02:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597569205; cv=none; d=google.com; s=arc-20160816; b=0s7kVAYxOQUPubqvk/R6PRpk4gtBpczhVSBYd5xipQnsYx5WaJYzWnh+jmn8PZPQbw KRn6abMqCWckEP3KesKDacCophX4WFTSyB/qNe7DJgOZsohbQdiuFe2miXQvBFOKoL9m DNu34NSmx5HTP86q7PedqSxloff7AsaWfHfsBD3G+LWg5lH0YGzULzBbJP57kTZ2hRfA jCvxpXpAGtWbo1OqFwIRdT5VDU3dHVR9LGBHsj6mf4SBJG4JuCQ7xvUY2ped8VCKLHHi 52PvuNM7jxT1vxsAMmNld7N/oBSNFBKJLAOAmamASyTp6LaYG7Knoby95uSvxkaK/NKJ 5Y3w== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=+w7jWuDj+prWa0IEJcK+RwKnK1Y4vdCU//6WZuG/yR0=; b=vr6CG/Z59maNTMoCN6mLNwNbetkk3VKtKRE3m1u4KVC0yN/q4rcVS87JXl4XiqRwjP RS9R/aujQ1ZRaR0E5oeApMR8CYLpN/H8kYGtQQl8PcdAMbmWsP+NBae4XwdmIXj8Gkd3 b8bmXgIdT2bg09SHGyx07h0JYwj3JU/nLr4817qLXepMbx5sauqvwnHtWTP3rkt25oQP +tlqir47q+cwbtaRepBkrGPlNmPXAuKO2TatFIzZ9+SB0ngfaUQOlqTSx2ublDVYkL2+ TjIH/Up0nYD5L4JgoxuOYXlWn7Xw5HsgRLFz8N9lcJqtJ4CjD6UctAYN3KDJXUQ5q6ly sN5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=n88tpd+3; 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 q16si8770589edv.34.2020.08.16.02.13.03; Sun, 16 Aug 2020 02:13:25 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=n88tpd+3; 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 S1726385AbgHPEJT (ORCPT + 99 others); Sun, 16 Aug 2020 00:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbgHPEJS (ORCPT ); Sun, 16 Aug 2020 00:09:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394CBC061786 for ; Sat, 15 Aug 2020 21:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+w7jWuDj+prWa0IEJcK+RwKnK1Y4vdCU//6WZuG/yR0=; b=n88tpd+3bXfovuKM3r7p8BYPUP CqVWIdLlaREhk0lIMsntjd4Q2OpO0FR5bKHA8lHcoxhCLCAdeM8+2qMogRlujRp+FkEpch3E3a02S o1t603FyW2VZAmGfurnoszG4rNGvFK8z2D6mC09a0MFGiENXzmPUse/8j52OTo0HmZSUqh7uc3Sj1 qeDq9W332dpXi+idfm75qkTe0YB6C/Vx3VfsBNmnRSFpBO68z6ZDgq/a8NjMfYNLfIcirlEMHuLmb ZMifEAFZZCcPzPIGbEYewonEmwQmOK9BAyZ8+kYOoQUm3WnRspaOlMSYNFxlMt25lH5sITZVL9EgI PzbQrkHw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k79yj-000195-9K; Sun, 16 Aug 2020 04:09:05 +0000 Date: Sun, 16 Aug 2020 05:09:05 +0100 From: Matthew Wilcox 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: <20200816040905.GF17456@casper.infradead.org> 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: > +++ b/mm/page_alloc.c > @@ -467,6 +467,8 @@ static inline int pfn_to_bitidx(struct page *page, unsigned long pfn) > return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS; > } > > +#define BITS_PER_CHAR 8 include/linux/bits.h:#define BITS_PER_BYTE 8 > bitmap = get_pageblock_bitmap(page, pfn); > bitidx = pfn_to_bitidx(page, pfn); > - word_bitidx = bitidx / BITS_PER_LONG; > - bitidx &= (BITS_PER_LONG-1); > + word_bitidx = bitidx / BITS_PER_CHAR; > + bitidx &= (BITS_PER_CHAR-1); It's not a word any more. it's a byte.