Re: [PATCH] mm/khugepaged: alloc_charge_hpage() take care of mem charge errors

From: David Stevens
Date: Tue Feb 21 2023 - 23:04:13 EST


On Wed, Feb 22, 2023 at 6:43 AM Peter Xu <peterx@xxxxxxxxxx> wrote:
>
> If memory charge failed, the caller shouldn't call mem_cgroup_uncharge().
> Let alloc_charge_hpage() handle the error itself and clear hpage properly
> if mem charge fails.
>
> Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
> Cc: Yang Shi <shy828301@xxxxxxxxx>
> Cc: David Stevens <stevensd@xxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 9d82c69438d0 ("mm: memcontrol: convert anon and file-thp to new mem_cgroup_charge() API")
> Signed-off-by: Peter Xu <peterx@xxxxxxxxxx>

Reviewed-by: David Stevens <stevensd@xxxxxxxxxxxx>