public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
To: David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Wei Yang <richardw.yang-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	yang.shi-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alexander.duyck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [Patch v3] mm: thp: grab the lock before manipulation defer list
Date: Fri, 17 Jan 2020 12:42:05 +0300	[thread overview]
Message-ID: <11ba0af7-c2b2-83f9-ac55-7793cedb8028@virtuozzo.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2001170132090.20618-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>

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?

  parent reply	other threads:[~2020-01-17  9:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16  1:31 [Patch v3] mm: thp: grab the lock before manipulation defer list Wei Yang
     [not found] ` <20200116013100.7679-1-richardw.yang-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2020-01-16  9:35   ` Kirill Tkhai
2020-01-16 22:01     ` David Rientjes
2020-01-17  0:47       ` Wei Yang
     [not found]       ` <alpine.DEB.2.21.2001161357240.109233-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2020-01-17  9:10         ` Michal Hocko
2020-01-17  9:26           ` Kirill Tkhai
2020-01-17  9:32             ` David Rientjes
     [not found]               ` <alpine.DEB.2.21.2001170132090.20618-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2020-01-17  9:42                 ` Kirill Tkhai [this message]
2020-01-17 11:59                   ` Michal Hocko
     [not found]           ` <20200117091002.GM19428-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2020-01-17  9:31             ` David Rientjes
2020-01-17 15:38               ` Kirill A. Shutemov
2020-01-17 19:11                 ` David Rientjes
2020-01-17 19:17                 ` Yang Shi
     [not found]                   ` <4d117021-da90-6069-1991-4df2249567f8-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org>
2020-01-17 22:18                     ` Wei Yang
2020-01-17 22:57                       ` Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11ba0af7-c2b2-83f9-ac55-7793cedb8028@virtuozzo.com \
    --to=ktkhai-5hdwgun5lf+gspxsjd1c4w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=alexander.duyck-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=richardw.yang-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=yang.shi-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox