Re: [PATCH] mm/shmem: add mTHP swpout fallback statistics in shmem_writeout()

From: Andrew Morton
Date: Tue Dec 16 2025 - 14:37:22 EST


On Tue, 16 Dec 2025 12:04:02 +0530 Anshuman Khandual <anshuman.khandual@xxxxxxx> wrote:

> > --- a/mm/shmem.c
> > +++ b/mm/shmem.c
> > @@ -1593,11 +1593,23 @@ int shmem_writeout(struct folio *folio, struct swap_iocb **plug,
> > }
> >
> > if (split) {
> > + int order;
> > +
>
> Could this be moved up near the 'nr_pages' declaration instead ?

It could, but I think it's good practice to restrict the scope of
things to "no more than necessary"?