lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11ba0af7-c2b2-83f9-ac55-7793cedb8028@virtuozzo.com>
Date:   Fri, 17 Jan 2020 12:42:05 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     David Rientjes <rientjes@...gle.com>
Cc:     Michal Hocko <mhocko@...nel.org>,
        Wei Yang <richardw.yang@...ux.intel.com>, hannes@...xchg.org,
        vdavydov.dev@...il.com, akpm@...ux-foundation.org,
        kirill.shutemov@...ux.intel.com, 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 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:

1)the first task unmapped a part of page and initiated splitting,
2)the second task still refers the whole page,

then we move account for the second task?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ