[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210305173809.ufg6rfgmvgbvwxih@box>
Date: Fri, 5 Mar 2021 20:38:09 +0300
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: akpm@...ux-foundation.org, riel@...hat.com,
kirill.shutemov@...ux.intel.com, ebru.akagunduz@...il.com,
dan.carpenter@...cle.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH 4/5] khugepaged: remove unnecessary mem_cgroup_uncharge()
in collapse_[file|huge_page]
On Thu, Mar 04, 2021 at 07:30:12AM -0500, Miaohe Lin wrote:
> Since commit 7ae88534cdd9 ("mm: move mem_cgroup_uncharge out of
> __page_cache_release()"), the mem_cgroup will be uncharged when hpage is
> freed. Uncharge mem_cgroup here is harmless but it looks confusing and
> buggy: if mem_cgroup charge failed, we will call mem_cgroup_uncharge()
> uncorrectly in error path because hpage is not IS_ERR_OR_NULL().
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
Hm. I'm not sure about this patch.
For !NUMA the page will get allocated and freed very early: in
khugepaged_do_scan() and with the change mem_cgroup_charge() may get
called twice for two different mm_structs.
Is it safe?
--
Kirill A. Shutemov
Powered by blists - more mailing lists