Re: [RFC] mm: Optimise put_pages_list()
From: Mel Gorman <hidden>
Date: 2021-10-04 09:10:42
Also in:
lkml
On Thu, Sep 30, 2021 at 05:32:58PM +0100, Matthew Wilcox (Oracle) wrote:
Instead of calling put_page() one page at a time, pop pages off the list if there are other refcounts and pass the remainder to free_unref_page_list(). This should be a speed improvement, but I have no measurements to support that. It's also not very widely used today, so I can't say I've really tested it. I'm only bothering with this patch because I'd like the IOMMU code to use it https://lore.kernel.org/lkml/20210930162043.3111119-1-willy@infradead.org/ (local) Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
I see your motivation but you need to check that all users of put_pages_list (current and future) handle destroy_compound_page properly or handle it within put_pages_list. For example, the release_pages() user of free_unref_page_list calls __put_compound_page directly before freeing. put_pages_list as it stands will call dstroy_compound_page but free_unref_page_list does not destroy compound pages in free_pages_prepare -- Mel Gorman SUSE Labs