linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Peter Xu <peterx@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH v2] mm: memory: check userfaultfd_wp() in vmf_orig_pte_uffd_wp()
Date: Fri, 19 Apr 2024 11:00:46 +0800	[thread overview]
Message-ID: <fe4c5e73-7242-4d35-ad76-1ee55cae6155@huawei.com> (raw)
In-Reply-To: <ZiFLHI8O1jwjqX-g@x1n>



On 2024/4/19 0:32, Peter Xu wrote:
> Hi, Kefeng,
> 
> On Thu, Apr 18, 2024 at 08:06:41PM +0800, Kefeng Wang wrote:
>> Add userfaultfd_wp() check in vmf_orig_pte_uffd_wp() to avoid the
>> unnecessary pte_marker_entry_uffd_wp() in most pagefault, difference
>> as shows below from perf data of lat_pagefault, note, the function
>> vmf_orig_pte_uffd_wp() is not inlined in the two kernel versions.
>>
>>    perf report -i perf.data.before | grep vmf
>>       0.17%     0.13%  lat_pagefault  [kernel.kallsyms]      [k] vmf_orig_pte_uffd_wp.part.0.isra.0
>>    perf report -i perf.data.after  | grep vmf
> 
> Any real number to share too besides the perf greps?  I meant, even if perf
> report will not report such function anymore, it doesn't mean it'll be
> faster, and how much it improves?

dd if=/dev/zero of=/tmp/XXX bs=512M count=1
./lat_pagefault -W 5 -N 5 /tmp/XXX

	before		after	
1	0.2623		0.2605	
2	0.2622		0.2598	
3	0.2621		0.2595	
4	0.2622		0.2600	
5	0.2651		0.2598	
6	0.2624		0.2594	
7	0.2624		0.2605	
8	0.2627		0.2608	
average	0.262675	0.2600375	-0.0026375

The lat_pagefault does show some improvement(also I reboot and retest,
the results are same).

> 
> Now we're switching from pte_marker_uffd_wp() check into a vma flag check.
> I think it makes more sense to compare the number rather than the perf
> reports, as the vma flag check instructions will be buried under other
> entries IIUC.
> 
> Thanks,
> 


  reply	other threads:[~2024-04-19  3:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 12:06 Kefeng Wang
2024-04-18 16:32 ` Peter Xu
2024-04-19  3:00   ` Kefeng Wang [this message]
2024-04-19 15:17     ` Peter Xu
2024-04-20  4:05       ` Kefeng Wang
2024-04-21 13:53         ` Peter Xu
2024-04-22  2:13           ` Kefeng Wang

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=fe4c5e73-7242-4d35-ad76-1ee55cae6155@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=peterx@redhat.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