linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: zhangqilong <zhangqilong3@huawei.com>
To: Vernon Yang <vernon2gm@gmail.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"david@redhat.com" <david@redhat.com>,
	"lorenzo.stoakes@oracle.com" <lorenzo.stoakes@oracle.com>,
	"ziy@nvidia.com" <ziy@nvidia.com>,
	"baolin.wang@linux.alibaba.com" <baolin.wang@linux.alibaba.com>,
	"Liam.Howlett@oracle.com" <Liam.Howlett@oracle.com>,
	"npache@redhat.com" <npache@redhat.com>,
	"ryan.roberts@arm.com" <ryan.roberts@arm.com>,
	"dev.jain@arm.com" <dev.jain@arm.com>,
	"baohua@kernel.org" <baohua@kernel.org>,
	"glider@google.com" <glider@google.com>,
	"elver@google.com" <elver@google.com>,
	"dvyukov@google.com" <dvyukov@google.com>,
	"vbabka@suse.cz" <vbabka@suse.cz>,
	"rppt@kernel.org" <rppt@kernel.org>,
	"surenb@google.com" <surenb@google.com>,
	"mhocko@suse.com" <mhocko@suse.com>,
	"muchun.song@linux.dev" <muchun.song@linux.dev>,
	"osalvador@suse.de" <osalvador@suse.de>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.or" <linux-kernel@vger.kernel.or>
Subject: Re: [RFC PATCH 0/7] add mTHP support for wp
Date: Tue, 19 Aug 2025 00:55:45 +0000	[thread overview]
Message-ID: <cca76935cc9f480d969340c914a44f3b@huawei.com> (raw)

> 
> Hi all,
> 
> This patchset is introduced to make pagefault write-protect copy support
> mthp, with this series, pagefault write-protect copy will have a 9-14%
> performance improvement.
> 
> Currently pagefaults on anonymous pages support mthp [1], and hardware
> features (such as arm64 contpte) can be used to store multiple ptes in one
> TLB entry, reducing the probability of TLB misses. However, when the
> process is forked and the cow is triggered again, the above optimization
> effect is lost, and only 4KB is requested once at a time.
> 
> Therefore, make pagefault write-protect copy support mthp to maintain the
> optimization effect of TLB and improve the efficiency of cow pagefault.
> 
> vm-scalability usemem shows a great improvement, test using: usemem -n
> 32 --prealloc --prefault 249062617 (result unit is KB/s, bigger is better)
> 
> |    size     | w/o patch | w/ patch  |  delta  |
> |-------------|-----------|-----------|---------|
> | baseline 4K | 723041.63 | 717643.21 | -0.75%  |
> | mthp 16K    | 732871.14 | 799513.18 | +9.09%  |
> | mthp 32K    | 746060.91 | 836261.83 | +12.09% |
> | mthp 64K    | 747333.18 | 855570.43 | +14.48% |
> 
> This series is based on Linux v6.16 (038d61fd6422).
> 
> Thanks,
> Vernon
> 
> [1] https://lore.kernel.org/all/20231207161211.2374093-1-
> ryan.roberts@arm.com/
> 
> Vernon Yang (7):
>   mm: memory: replace single-operation with multi-operation in wp
>   mm: memory: add ptep_clear_flush_range function
>   mm: memory: add kmsan_copy_pages_meta function
>   mm: memory: add offset to start copy for copy_user_gigantic_page
>   mm: memory: improve wp_page_copy readability
>   mm: memory: add mTHP support for wp

Oh, we are also doing similar optimizations, but only for the code segment. :)

>   selftests: mm: support wp mTHP collapse testing
> 
>  include/linux/huge_mm.h                 |   3 +
>  include/linux/kmsan.h                   |  13 +-
>  include/linux/mm.h                      |   8 +
>  include/linux/pgtable.h                 |   3 +
>  mm/hugetlb.c                            |   6 +-
>  mm/kmsan/shadow.c                       |  26 +-
>  mm/memory.c                             | 309 ++++++++++++++++++------
>  mm/pgtable-generic.c                    |  20 ++
>  tools/testing/selftests/mm/khugepaged.c |   5 +-
>  9 files changed, 302 insertions(+), 91 deletions(-)
> 
> --
> 2.50.1
> 



             reply	other threads:[~2025-08-19  0:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19  0:55 zhangqilong [this message]
2025-08-19 18:21 ` Vernon Yang
  -- strict thread matches above, loose matches on Subject: below --
2025-08-14 11:38 Vernon Yang

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=cca76935cc9f480d969340c914a44f3b@huawei.com \
    --to=zhangqilong3@huawei.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=linux-kernel@vger.kernel.or \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=npache@redhat.com \
    --cc=osalvador@suse.de \
    --cc=richardcochran@gmail.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=vernon2gm@gmail.com \
    --cc=ziy@nvidia.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