From: Yang Shi <yang.shi@linux.alibaba.com>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: ktkhai@virtuozzo.com, kirill.shutemov@linux.intel.com,
hannes@cmpxchg.org, mhocko@suse.com, hughd@google.com,
shakeelb@google.com, rientjes@google.com,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [v3 PATCH 2/4] mm: move mem_cgroup_uncharge out of __page_cache_release()
Date: Thu, 13 Jun 2019 10:13:19 -0700 [thread overview]
Message-ID: <2909ce59-86ba-ea0b-479f-756020fb32af@linux.alibaba.com> (raw)
In-Reply-To: <20190613113943.ahmqpezemdbwgyax@box>
On 6/13/19 4:39 AM, Kirill A. Shutemov wrote:
> On Thu, Jun 13, 2019 at 05:56:47AM +0800, Yang Shi wrote:
>> The later patch would make THP deferred split shrinker memcg aware, but
>> it needs page->mem_cgroup information in THP destructor, which is called
>> after mem_cgroup_uncharge() now.
>>
>> So, move mem_cgroup_uncharge() from __page_cache_release() to compound
>> page destructor, which is called by both THP and other compound pages
>> except HugeTLB. And call it in __put_single_page() for single order
>> page.
>
> If I read the patch correctly, it will change behaviour for pages with
> NULL_COMPOUND_DTOR. Have you considered it? Are you sure it will not break
> anything?
So far a quick search shows NULL_COMPOUND_DTOR is not used by any type
of compound page. The HugeTLB code sets destructor to NULL_COMPOUND_DTOR
when freeing hugetlb pages via hugetlb specific destructor.
The prep_new_page() would call prep_compound_page() if __GFP_COMP is
used, which sets dtor to COMPOUND_PAGE_DTOR by default. Just hugetlb
and THP set their specific dtors.
And, it looks __put_compound_page() doesn't check if dtor is NULL or not
at all.
>
next prev parent reply other threads:[~2019-06-13 17:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 21:56 [v3 PATCH 0/4] Make deferred split shrinker memcg aware Yang Shi
2019-06-12 21:56 ` [v3 PATCH 1/4] mm: thp: extract split_queue_* into a struct Yang Shi
2019-06-12 21:56 ` [v3 PATCH 2/4] mm: move mem_cgroup_uncharge out of __page_cache_release() Yang Shi
2019-06-13 11:39 ` Kirill A. Shutemov
2019-06-13 17:13 ` Yang Shi [this message]
2019-06-24 16:54 ` Yang Shi
2019-06-25 9:35 ` Kirill A. Shutemov
2019-06-25 15:49 ` Yang Shi
2019-06-12 21:56 ` [v3 PATCH 3/4] mm: shrinker: make shrinker not depend on memcg kmem Yang Shi
2019-06-25 22:14 ` Andrew Morton
2019-06-25 22:30 ` Yang Shi
2019-06-12 21:56 ` [v3 PATCH 4/4] mm: thp: make deferred split shrinker memcg aware Yang Shi
2019-06-25 22:00 ` Andrew Morton
2019-06-25 22:33 ` Yang Shi
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=2909ce59-86ba-ea0b-479f-756020fb32af@linux.alibaba.com \
--to=yang.shi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=shakeelb@google.com \
/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