From: Andrew Morton <akpm@linux-foundation.org>
To: Liu Shixin <liushixin2@huawei.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH] mm/huge_memory: prevent THP_ZERO_PAGE_ALLOC increased twice
Date: Wed, 7 Sep 2022 16:35:32 -0700 [thread overview]
Message-ID: <20220907163532.413d52275e8a8d865e9321d2@linux-foundation.org> (raw)
In-Reply-To: <a694528c-f572-c651-24b3-77915053f992@huawei.com>
On Tue, 6 Sep 2022 09:52:23 +0800 Liu Shixin <liushixin2@huawei.com> wrote:
> On 2022/9/6 4:07, Andrew Morton wrote:
> > On Mon, 5 Sep 2022 21:38:13 +0800 Liu Shixin <liushixin2@huawei.com> wrote:
> >
> >> If two or more threads call get_huge_zero_page concurrently, THP_ZERO_PAGE_ALLOC
> >> may increased two or more times. But actually, this should only count
> >> as once since the extra zero pages has been freed.
> > Well, for better of for worse,
> > Documentation/admin-guide/mm/transhuge.rst says
> >
> > thp_zero_page_alloc
> > is incremented every time a huge zero page is
> > successfully allocated. It includes allocations which where
> > dropped due race with other allocation. Note, it doesn't count
> > every map of the huge zero page, only its allocation.
> >
> > If you think this interprtation should be changed then please explain
> > why, and let's be sure to update the documentation accordingly.
> >
> > .
> Thanks for your explanation. I misunderstood the meaning of thp_zero_page_alloc before.
> Although the rules are clearly explained in the documentation, I think that this variable
> should only incremented when a huge zero page used for thp is successfully allocated and
> the pages dropped due race should skip increment. It seems strange to count in all allocations.
>
> If there's something I still misunderstand, please point it out, thanks.
It seems strange to me also. Perhaps there's a rationale buried in the
git and mailing list history.
next prev parent reply other threads:[~2022-09-07 23:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-05 13:38 Liu Shixin
2022-09-05 20:07 ` Andrew Morton
2022-09-06 1:52 ` Liu Shixin
2022-09-07 23:35 ` Andrew Morton [this message]
2022-09-08 3:28 ` Liu Shixin
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=20220907163532.413d52275e8a8d865e9321d2@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liushixin2@huawei.com \
--cc=wangkefeng.wang@huawei.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
all inboxes | Powered by JetHome®