Re: [PATCH] page_alloc: Fix freeing non-compound pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux