Re: [PATCH v2] mm: Optimise put_pages_list()

From: Andrew Morton
Date: Thu Oct 07 2021 - 15:31:13 EST


On Thu, 7 Oct 2021 20:21:37 +0100 "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> wrote:

> Instead of calling put_page() one page at a time, pop pages off
> the list if their refcount was too high and pass the remainder to
> put_unref_page_list(). This should be a speed improvement, but I have
> no measurements to support that. Current callers do not care about
> performance, but I hope to add some which do.

Don't you think it would actually be slower to take an additional pass
across the list? If the list is long enough to cause cache thrashing.
Maybe it's faster for small lists.