[PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-27 Thread Peter Xu
I observed that for each of the shared file-backed page faults, we're very likely to retry one more time for the 1st write fault upon no page. It's because we'll need to release the mmap lock for dirty rate limit purpose with balance_dirty_pages_ratelimited() (in fault_dirty_shared_page()). Then

Re: [PATCH v3] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-27 Thread Peter Xu
On Fri, May 27, 2022 at 12:46:31PM +0200, Ingo Molnar wrote: > > * Peter Xu wrote: > > > This patch provides a ~12% perf boost on my aarch64 test VM with a simple > > program sequentially dirtying 400MB shmem file being mmap()ed and these are > > the time it needs: > > > > Before: 650.980 ms

Re: [PATCH v3] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-27 Thread Peter Xu
Hi, Heiko, On Fri, May 27, 2022 at 02:23:42PM +0200, Heiko Carstens wrote: > On Tue, May 24, 2022 at 07:45:31PM -0400, Peter Xu wrote: > > I observed that for each of the shared file-backed page faults, we're very > > likely to retry one more time for the 1st write fault upon no page. It's > >

Re: [PATCH v3] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-27 Thread Heiko Carstens
On Tue, May 24, 2022 at 07:45:31PM -0400, Peter Xu wrote: > I observed that for each of the shared file-backed page faults, we're very > likely to retry one more time for the 1st write fault upon no page. It's > because we'll need to release the mmap lock for dirty rate limit purpose > with

[PATCH v2 3/3] sparc64: bitops: Change __fls to return unsigned long

2022-05-27 Thread Amadeusz Sławiński
As per asm-generic definition and other architectures __fls should return unsigned long. No functional change is expected as return value should fit in unsigned long. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- arch/sparc/include/asm/bitops_64.h | 2 +- 1 file changed,

[PATCH v2 1/3] ARC: bitops: Change __fls to return unsigned long

2022-05-27 Thread Amadeusz Sławiński
As per asm-generic definition and other architectures __fls should return unsigned long. No functional change is expected as return value should fit in unsigned long. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- arch/arc/include/asm/bitops.h | 4 ++-- 1 file changed, 2

[PATCH v2 2/3] m68k: bitops: Change __fls to return and accept unsigned long

2022-05-27 Thread Amadeusz Sławiński
As per asm-generic definition and other architectures __fls should return and accept unsigned long as its parameter. No functional change is expected as return value should fit in unsigned long. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński --- arch/m68k/include/asm/bitops.h

[PATCH v2 0/3] bitops: __fls adjustments

2022-05-27 Thread Amadeusz Sławiński
Apparently on few architectures __fls is defined incorrectly. Fix this by adjusting declarations to asm-generic ones. As far as I can tell there should be no functional changes, but I don't have devices to test it, so it was only compile tested. Changes in v2: - change both declarations in ARC

Re: [PATCH v3] mm: Avoid unnecessary page fault retires on shared memory types

2022-05-27 Thread Ingo Molnar
* Peter Xu wrote: > This patch provides a ~12% perf boost on my aarch64 test VM with a simple > program sequentially dirtying 400MB shmem file being mmap()ed and these are > the time it needs: > > Before: 650.980 ms (+-1.94%) > After: 569.396 ms (+-1.38%) Nice! > arch/x86/mm/fault.c

Re: [PATCH 1/2] ARC: bitops: Change __fls to return unsigned long

2022-05-27 Thread Amadeusz Sławiński
On 5/26/2022 5:42 AM, Vineet Gupta wrote: Hi, On 5/25/22 07:48, Amadeusz Sławiński wrote: As per asm-generic definition and other architectures __fls should return unsigned long. No functional change is expected as return value should fit in unsigned long. Signed-off-by: Amadeusz Sławiński