Re: [PATCH v2] mm/page_alloc: Dedupe some memcg uncharging logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 8, 2023 at 3:52 PM Shakeel Butt <shakeelb@xxxxxxxxxx> wrote:
>
> On Wed, Nov 8, 2023 at 8:49 AM Brendan Jackman <jackmanb@xxxxxxxxxx> wrote:
> >
> > The duplication makes it seem like some work is required before
> > uncharging in the !PageHWPoison case. But it isn't, so we can simplify
> > the code a little.
> >
> > Note the PageMemcgKmem check is redundant, but I've left it in as it
> > avoids an unnecessary function call.
> >
> > Signed-off-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
>
> Thanks for the patch. Actually the PageMemcgKmem/folio_memcg_kmem
> check should be in memcg_kmem_uncharge_page() and not in
> __memcg_kmem_uncharge_page(). Anyways, that is orthogonal to this
> patch.

Agreed. If we move the check into memcg_kmem_uncharge_page(), perhaps
we should call it directly here instead of doing the checks, since
there won't be an extra function call as it is inline, right? We can
also make __memcg_kmem_uncharge_page static to mm/memcontrol.c

I suspect the same can be done for __memcg_kmem_charge_page() as well.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux