Re: [mm 4.15-rc8] Random oopses under memory pressure.

From: Dave Hansen
Date: Wed Jan 17 2018 - 17:01:00 EST


On 01/17/2018 01:39 PM, Linus Torvalds wrote:
>
> So maybe something like this to test the theory?
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 76c9688b6a0a..f919a5548943 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -756,6 +756,8 @@ static inline void rmv_page_order(struct page *page)
> static inline int page_is_buddy(struct page *page, struct page *buddy,
> unsigned int order)
> {
> + if (WARN_ON_ONCE(page_zone(page) != page_zone(buddy)))
> + return 0;
> if (page_is_guard(buddy) && page_order(buddy) == order) {
> if (page_zone_id(page) != page_zone_id(buddy))
> return 0;

I thought that page_zone_id() stuff was there to prevent this kind of
cross-zone stuff from happening.