From: David Hildenbrand <david@redhat.com>
To: Lance Yang <ioworker0@gmail.com>
Cc: akpm@linux-foundation.org, mhocko@suse.com, zokeefe@google.com,
shy828301@gmail.com, xiehuan09@gmail.com,
songmuchun@bytedance.com, minchan@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, libang.li@antgroup.com
Subject: Re: [PATCH 1/1] mm/khugepaged: reduce process visible downtime by pre-zeroing hugepage
Date: Fri, 15 Mar 2024 13:18:24 +0100 [thread overview]
Message-ID: <893fd7d3-6f11-45ee-8fe6-52f11dc42cc7@redhat.com> (raw)
In-Reply-To: <CAK1f24ktQMYogUETyu04KahC1YAdrY1XwCNNrYUQXN4tSEPKsQ@mail.gmail.com>
On 14.03.24 15:19, Lance Yang wrote:
> Another thought suggested by Bang Li is that we record which pte is none
> in hpage_collapse_scan_pmd. Then, before acquiring the mmap_lock (write mode),
> we will pre-zero pages as needed.
Here is my point of view: we cannot optimize the common case where we
have mostly !pte_none() in a similar way.
So why do we care about the less common case? Is the process visible
downtime reduction for that less common case really noticable?
Or is it rather something that looks good in a micro-benchmark, but
won't really make any difference in actual applications (again, where
the common case will still result the same downtime).
I'm not against this, I'm rather wonder "do we really care". I'd like to
hear other opinions.
>>>>>
>>>>> So my question is: do we really care about it that much that we care to
>>>>> optimize?
>>>>
>>>> IMO, although it may not be our main concern, reducing the impact of
>>>> khugepaged on the process remains crucial. I think that users also prefer
>>>> minimal interference from khugepaged.
>>>
>>> The problem I am having with this is that for the *common* case where we
>>> have a small number of pte_none(), we cannot really optimize because we
>>> have to perform the copy.
>>>
>>> So this feels like we're rather optimizing a corner case, and I am not
>>> so sure if that is really worth it.
>>>
>>> Other thoughts?
>>
>> Another thought is to introduce khugepaged/alloc_zeroed_hpage for THP
>> sysfs settings. This would enable users to decide whether to avoid unnecessary
>> copies when nr_ptes_none > 0.
Hm, new toggles for that, not sure ... I much rather prefer something
without any new toggles, especially for this case.
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2024-03-15 12:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 7:49 [PATCH 1/1] mm/khugepaged: reduce process visible downtime by pre-zeroing hugepage Lance Yang
2024-03-11 16:19 ` David Hildenbrand
2024-03-12 13:09 ` Lance Yang
2024-03-12 13:19 ` David Hildenbrand
2024-03-12 13:55 ` Lance Yang
2024-03-14 14:19 ` Lance Yang
2024-03-15 12:18 ` David Hildenbrand [this message]
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=893fd7d3-6f11-45ee-8fe6-52f11dc42cc7@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ioworker0@gmail.com \
--cc=libang.li@antgroup.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=shy828301@gmail.com \
--cc=songmuchun@bytedance.com \
--cc=xiehuan09@gmail.com \
--cc=zokeefe@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;
as well as URLs for NNTP newsgroup(s).