[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL1ERfOxEJGJjZk9O_NKV82mOT+udto0tL2eCagicLig6CaJ=g@mail.gmail.com>
Date: Wed, 10 Dec 2014 21:38:42 +0800
From: Weijie Yang <weijie.yang.kh@...il.com>
To: Mel Gorman <mgorman@...e.de>
Cc: Weijie Yang <weijie.yang@...sung.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Rik van Riel <riel@...hat.com>,
Linux-MM <linux-mm@...ck.org>,
Linux-Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: page_alloc: place zone id check before VM_BUG_ON_PAGE check
On Tue, Dec 9, 2014 at 5:59 PM, Mel Gorman <mgorman@...e.de> wrote:
> On Tue, Dec 09, 2014 at 03:40:35PM +0800, Weijie Yang wrote:
>> If the free page and its buddy has different zone id, the current
>> zone->lock cann't prevent buddy page getting allocated, this could
>> trigger VM_BUG_ON_PAGE in a very tiny chance:
>>
>
> Under what circumstances can a buddy page be allocated without the
> zone->lock? Any parallel allocation from that zone that takes place will
> be from the per-cpu allocator and should not be affected by this. Have
> you actually hit this race?
My description maybe not clear, if the free page and its buddy is not
at the same zone, the holding zone->lock cann't prevent buddy page
getting allocated.
zone_1->lock prevents the freeing page getting allocated
zone_2->lock prevents the buddy page getting allocated
they are not the same zone->lock.
I found it when review the code, not a running test.
However, if we cann't remove the zone_id check statement, I think
we should handle this rare race.
If I miss something or make a mistake, please let me know.
Thanks
> --
> Mel Gorman
> SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists