[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200117115935.GW19428@dhcp22.suse.cz>
Date: Fri, 17 Jan 2020 12:59:35 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Kirill Tkhai <ktkhai@...tuozzo.com>, g@...e.cz,
kirill.shutemov@...ux.intel.com
Cc: David Rientjes <rientjes@...gle.com>,
Wei Yang <richardw.yang@...ux.intel.com>, hannes@...xchg.org,
vdavydov.dev@...il.com, akpm@...ux-foundation.or,
yang.shi@...ux.alibaba.com, cgroups@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
alexander.duyck@...il.com, stable@...r.kernel.org
Subject: Re: [Patch v3] mm: thp: grab the lock before manipulation defer list
On Fri 17-01-20 12:42:05, Kirill Tkhai wrote:
> On 17.01.2020 12:32, David Rientjes wrote:
> > On Fri, 17 Jan 2020, Kirill Tkhai wrote:
> >
> >>>> I think that's a good point, especially considering that the current code
> >>>> appears to unconditionally place any compound page on the deferred split
> >>>> queue of the destination memcg. The correct list that it should appear
> >>>> on, I believe, depends on whether the pmd has been split for the process
> >>>> being moved: note the MC_TARGET_PAGE caveat in
> >>>> mem_cgroup_move_charge_pte_range() that does not move the charge for
> >>>> compound pages with split pmds. So when mem_cgroup_move_account() is
> >>>> called with compound == true, we're moving the charge of the entire
> >>>> compound page: why would it appear on that memcg's deferred split queue?
> >>>
> >>> I believe Kirill asked how do we know that the page should be actually
> >>> added to the deferred list just from the list_empty check. In other
> >>> words what if the page hasn't been split at all?
> >>
> >> Yes, I'm talking about this. Function mem_cgroup_move_account() adds every
> >> huge page to the deferred list, while we need to do that only for pages,
> >> which are queued for splitting...
> >>
> >
> > Yup, and that appears broken before Wei's patch. Since we only migrate
> > charges of entire compound pages (we have a mapping pmd, the underlying
> > page cannot be split), it should not appear on the deferred split queue
> > for any memcg, right?
>
> Hm. Can't a huge page be mapped in two tasks:
It can but it will get charged to only of the initially. I haven't
checked the THP code in that aspect but from what I remember subpages
shouldn't refer to different memcgs. Kirill Shutemov?
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists