Re: [PATCH v4 1/5] mm/vmscan: introduce folio_activate_locked() helper

From: Zhang Peng

Date: Sun Jun 28 2026 - 12:09:29 EST


On Wed, Jun 17, 2026 at 01:59:55PM +0200, David Hildenbrand wrote:
> Passing nr_pages to this helper is rather questionable. Just use
> folio_nr_pages(folio) here and make the function less weird.
>
> Do we want to add a
>     VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio);
>
> While at it, do we want to turn this to a VM_WARN_ON_ONCE_FOLIO?
> (and can we move that to the beginning of the function?)

Yep, all makes sense.  Will drop nr_pages, add the locked check at the
top, and switch the BUG_ON to WARN_ON_ONCE — panicking over a bogus
active flag is overkill.