From: Michal Hocko <mhocko@suse.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
Prathu Baronia <prathu.baronia@oneplus.com>,
Chintan Pandya <chintan.pandya@oneplus.com>,
akpm@linux-foundation.com, linux-mm <linux-mm@kvack.org>,
gregkh@linuxfoundation.com, Greg Thelen <gthelen@google.com>,
jack@suse.cz, Ken Lin <ken.lin@oneplus.com>,
Gasine Xu <gasine.xu@oneplus.com>
Subject: Re: [PATCH v2] mm: Optimized hugepage zeroing & copying from user
Date: Wed, 15 Apr 2020 13:09:44 +0200 [thread overview]
Message-ID: <20200415110944.GG4629@dhcp22.suse.cz> (raw)
In-Reply-To: <87mu7dza9x.fsf@yhuang-dev.intel.com>
On Wed 15-04-20 11:40:42, Huang, Ying wrote:
> Alexander Duyck <alexander.duyck@gmail.com> writes:
[...]
> > If you take a look at commit c6ddfb6c58903 ("mm, clear_huge_page: move
> > order algorithm into a separate function") they were running the tests
> > on multiple threads simultaneously as their concern was flooding the
> > LLC cache. I wonder if we couldn't look at bypassing the cache
> > entirely using something like __copy_user_nocache for some portion of
> > the copy and then only copy in the last pieces that we think will be
> > immediately accessed.
>
> The problem is how to determine the size of the pieces that will be
> immediately accessed?
Well, this really depends. If you are in a page fault path then it
should be quite obvious that at least the faulting subpage will be
accessed. It is hard to make any assumptions beyond that. THP might
behave very different from hugetlb pages because the former is an
optimistic optimization and the rest of the page might not be used
immediately. Hugetlb pages, on the other hand, are more likely to use
a larger part of the page because then there is a clear memory loss.
Then you have MAP_POPULATE or alike and then optimizing for future
access sounds like a pointless exercise because this is essentially a
stream initialization without any clue which memory will be used
shortly.
All that being said I am not against optimizing clear_huge_page but
please stick to some real life usecases which actually benefit from
the optimization. If there are any arch specific nuances then make them
arch specific. Focusing on microbenchmarks is just leading to a complex
code which might turn out suboptimal in some cases.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-04-15 11:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 15:38 Prathu Baronia
2020-04-14 17:03 ` Michal Hocko
2020-04-14 17:41 ` Daniel Jordan
[not found] ` <20200414184743.GB2097@oneplus.com>
2020-04-14 19:32 ` Alexander Duyck
2020-04-15 3:40 ` Huang, Ying
2020-04-15 11:09 ` Michal Hocko [this message]
2020-04-19 12:05 ` Prathu Baronia
2020-04-14 19:40 ` Michal Hocko
2020-04-15 3:27 ` Huang, Ying
2020-04-16 1:21 ` Huang, Ying
2020-04-19 15:58 ` Prathu Baronia
2020-04-20 0:18 ` Huang, Ying
2020-04-21 9:36 ` Prathu Baronia
2020-04-21 10:09 ` Will Deacon
2020-04-21 12:47 ` Vlastimil Babka
2020-04-21 12:48 ` Vlastimil Babka
2020-04-21 13:39 ` Will Deacon
2020-04-21 13:48 ` Vlastimil Babka
2020-04-21 13:56 ` Chintan Pandya
2020-04-22 8:18 ` Will Deacon
2020-04-22 11:19 ` Will Deacon
2020-04-22 14:38 ` Prathu Baronia
2020-05-01 8:58 ` Prathu Baronia
2020-05-05 8:59 ` Will Deacon
2020-04-21 13:00 ` Michal Hocko
2020-04-21 13:10 ` Will Deacon
2020-04-17 7:48 ` [mm] 134c8b410f: vm-scalability.median -7.9% regression kernel test robot
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=20200415110944.GG4629@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.com \
--cc=alexander.duyck@gmail.com \
--cc=chintan.pandya@oneplus.com \
--cc=gasine.xu@oneplus.com \
--cc=gregkh@linuxfoundation.com \
--cc=gthelen@google.com \
--cc=jack@suse.cz \
--cc=ken.lin@oneplus.com \
--cc=linux-mm@kvack.org \
--cc=prathu.baronia@oneplus.com \
--cc=ying.huang@intel.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