Re: [PATCH v5 4/5] mm/vmscan: extract folio unmap logic into folio_try_unmap()
Barry Song <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.kernel.mm |
|---|---|
| Message-ID | <CAGsJ_4xYDHMF41uVAaCP1=R5xKmNxkGtCd=YvaP_3Rd2ZEpbBQ@mail.gmail.com> |
On Mon, Jul 20, 2026 at 1:08 PM Zhang Peng <[email protected]> wrote: > > shrink_folio_list() contains a self-contained block that sets up > TTU flags and calls try_to_unmap(), accounting for failures via > reclaim_stat. Extract it into folio_try_unmap() to reduce the size > of shrink_folio_list() and make the unmap step independently readable. > > folio_try_unmap() is only called when the folio is actually mapped; > the !folio_mapped() check stays in the caller, keeping the function's > semantics clear: it tries to unmap a mapped folio and returns whether > the unmap succeeded. > > No functional change. > > Signed-off-by: Zhang Peng <[email protected]> Reviewed-by: Barry Song <[email protected]>