[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200816040905.GF17456@casper.infradead.org>
Date: Sun, 16 Aug 2020 05:09:05 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Alex Shi <alex.shi@...ux.alibaba.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>,
Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm/pageblock: mitigation cmpxchg false sharing in
pageblock flags
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.
Powered by blists - more mailing lists