[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xa1teh4hbk05.fsf@mina86.com>
Date: Thu, 09 Jan 2014 10:08:10 +0100
From: Michal Nazarewicz <mina86@...a86.com>
To: Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Rik van Riel <riel@...hat.com>,
Jiang Liu <jiang.liu@...wei.com>, Mel Gorman <mgorman@...e.de>,
Cody P Schafer <cody@...ux.vnet.ibm.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...e.cz>,
Minchan Kim <minchan@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
Tang Chen <tangchen@...fujitsu.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Joonsoo Kim <js1304@...il.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCH 1/7] mm/page_alloc: synchronize get/set pageblock
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@...gle.com>--<xmpp:mina86@...ber.org>--ooO--(_)--Ooo--
Download attachment "signature.asc" of type "application/pgp-signature" (836 bytes)
Powered by blists - more mailing lists