lkml.org 
[lkml]   [2014]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/7] mm/page_alloc: synchronize get/set pageblock
Date
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@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-01-09 11:21    [W:0.127 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site