Re: [PATCH 1/2] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux