Re: [PATCH 1/7] mm/page_alloc: synchronize get/set pageblock

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

 



On Thu, Jan 09 2014, Joonsoo Kim wrote:
> @@ -5927,15 +5928,19 @@ unsigned long get_pageblock_flags_group(struct page *page,
>  	unsigned long pfn, bitidx;
>  	unsigned long flags = 0;
>  	unsigned long value = 1;
> +	unsigned int seq;
>  
>  	zone = page_zone(page);
>  	pfn = page_to_pfn(page);
>  	bitmap = get_pageblock_bitmap(zone, pfn);
>  	bitidx = pfn_to_bitidx(zone, pfn);
>  
> -	for (; start_bitidx <= end_bitidx; start_bitidx++, value <<= 1)
> -		if (test_bit(bitidx + start_bitidx, bitmap))
> -			flags |= value;
> +	do {

+		flags = 0;

> +		seq = read_seqbegin(&zone->pageblock_seqlock);
> +		for (; start_bitidx <= end_bitidx; start_bitidx++, value <<= 1)
> +			if (test_bit(bitidx + start_bitidx, bitmap))
> +				flags |= value;
> +	} while (read_seqretry(&zone->pageblock_seqlock, seq));
>  
>  	return flags;
>  }

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>--ooO--(_)--Ooo--

Attachment: signature.asc
Description: PGP signature


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