[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200922143559.GF32101@casper.infradead.org>
Date: Tue, 22 Sep 2020 15:35:59 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Nick Piggin <npiggin@...e.de>, Hugh Dickins <hughd@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] page_alloc: Fix freeing non-compound pages
On Tue, Sep 22, 2020 at 03:00:17PM +0100, Matthew Wilcox (Oracle) wrote:
> void __free_pages(struct page *page, unsigned int order)
> {
> if (put_page_testzero(page))
> free_the_page(page, order);
> + else
> + while (order-- > 0)
> + free_the_page(page + (1 << order), order);
> }
> EXPORT_SYMBOL(__free_pages);
... a three line patch and one of them is wrong.
- else
+ else if (!PageHead(page))
Anyone got a smart idea about how to _test_ this code path? I'm
wondering about loading one kernel module which wanders through memmap
calling
if (page_cache_get_speculative(page)) put_page(page);
and another kernel module that calls
__free_pages(alloc_page(GFP_KERNEL, 1), 1);
and putting in a printk to let me know when we hit it.
Powered by blists - more mailing lists