lkml.org 
[lkml]   [2020]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2020-09-22 16:36    [W:0.062 / U:1.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site