Re: [PATCH 0/4] mm/vmstat: simplify folio stat APIs

Matthew Wilcox
2026-04-15T03:59:45Z

On Wed, Apr 15, 2026 at 08:47:24AM +0800, Ye Liu wrote:
> Thank you for your feedback, Matthew. I acknowledge that this change may
> introduce additional calls to folio_nr_pages() in some cases where the
> value was previously computed once and reused. However, the new
> add_folio/sub_folio functions provide clearer semantics, explicitly
> indicating that we're accounting for the entire folio rather than
> potentially partial pages. The overhead of recomputing folio_nr_pages()
> is minimal in most scenarios, and the improved readability and reduced
> argument passing outweigh this concern.

I disagree.