Re: [PATCH 2/2] memcg/hugetlb: Deprecate hugetlb memcg try-commit-cancel charging

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

 



On Wed, Nov 6, 2024 at 6:50 PM Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
>
> Please cleanup mem_cgroup_cancel_charge() and mem_cgroup_commit_charge()
> as well as there will be no users after this patch.
>

Hi Shakeel,

Thank you for your feedback. Unfortunately, it seems like even after this
patch removes the references from hugetlb.c, there are still some
references from other files.

mem_cgroup_cancel_charge:
  - memcontrol-v1.c~__mem_cgroup_clear_mc(void)

mem_cgroup_commit_charge:
  - memcontrol.c~charge_memcg(struct folio *folio, struct mem_cgroup...)

In fact, in my patch, I add an extra call to charge_memcg. I think for this
case, it makes sense to just extract out the functionality from
mem_cgroup_commit_charge (3 lines) and expand it out inside charge_memcg,
and get rid of mem_cgroup_commit_charge.

On the other hand, handling mem_cgroup_cancel_charge seems to be a bit
different. Now, all of its references are purely in memcontrol-v1.c.
I think in this case, it makes sense to migrate the function declaration
& definition into memcontrol-v1.c, and remove it from memcontrol.c.
Perhaps at a later date, a cleanup in memcontrol-v1 may find that it makes
sense to remove the function, but for now, I think we should just move it.

I hope this makes sense. Thank you again for your feedback!
Joshua





[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