Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking

2023-08-10 Thread Suren Baghdasaryan
On Wed, Aug 9, 2023 at 2:07 PM Mateusz Guzik wrote: > > On 8/5/23, Suren Baghdasaryan wrote: > > On Fri, Aug 4, 2023 at 6:06 PM Mateusz Guzik wrote: > >> > >> On 8/5/23, Linus Torvalds wrote: > >> > On Fri, 4 Aug 2023 at 16:25, Mateusz Guzik wrot

Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking

2023-08-04 Thread Suren Baghdasaryan
On Fri, Aug 4, 2023 at 6:17 PM Mateusz Guzik wrote: > > On 8/5/23, Suren Baghdasaryan wrote: > > On Fri, Aug 4, 2023 at 5:49 PM Mateusz Guzik wrote: > >> However, the other users (that I know of ) go through the mmap > >> semaphore to mess with anyth

Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking

2023-08-04 Thread Suren Baghdasaryan
On Fri, Aug 4, 2023 at 5:15 PM Linus Torvalds wrote: > > On Fri, 4 Aug 2023 at 16:25, Mateusz Guzik wrote: > > > > I know of these guys, I think they are excluded as is -- they go > > through access_remote_vm, starting with: > > if (mmap_read_lock_killable(mm)) > > return

Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking

2023-08-04 Thread Suren Baghdasaryan
On Fri, Aug 4, 2023 at 5:26 PM Suren Baghdasaryan wrote: > > On Fri, Aug 4, 2023 at 5:15 PM Linus Torvalds > wrote: > > > > On Fri, 4 Aug 2023 at 16:25, Mateusz Guzik wrote: > > > > > > I know of these guys, I think they are excluded as is -- they go &

Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking

2023-08-04 Thread Suren Baghdasaryan
On Fri, Aug 4, 2023 at 5:49 PM Mateusz Guzik wrote: > > On 8/5/23, Suren Baghdasaryan wrote: > > On Fri, Aug 4, 2023 at 5:26 PM Suren Baghdasaryan > > wrote: > >> > >> On Fri, Aug 4, 2023 at 5:15 PM Linus Torvalds > >> wrote: > >> >

Re: [PATCH v2 3/3] fork: lock VMAs of the parent process when forking

2023-08-04 Thread Suren Baghdasaryan
On Fri, Aug 4, 2023 at 6:06 PM Mateusz Guzik wrote: > > On 8/5/23, Linus Torvalds wrote: > > On Fri, 4 Aug 2023 at 16:25, Mateusz Guzik wrote: > >> > >> I know of these guys, I think they are excluded as is -- they go > >> through access_remote_vm, starting with: > >> if

Re: [PATCH v4 29/33] x86/mm: try VMA lock-based page fault handling first

2023-06-29 Thread Suren Baghdasaryan
On Thu, Jun 29, 2023 at 7:40 AM Jiri Slaby wrote: > > Hi, > > On 27. 02. 23, 18:36, Suren Baghdasaryan wrote: > > Attempt VMA lock-based page fault handling first, and fall back to the > > existing mmap_lock-based handling if that fails. > > > &g

Re: [PATCH v4 29/33] x86/mm: try VMA lock-based page fault handling first

2023-06-30 Thread Suren Baghdasaryan
On Fri, Jun 30, 2023 at 1:43 AM Jiri Slaby wrote: > > On 30. 06. 23, 10:28, Jiri Slaby wrote: > > > 2348 > > clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, > > child_tid=0x7fcaa5882990,

[PATCH 1/1] arch/mm/fault: fix major fault accounting when retrying under per-VMA lock

2023-12-26 Thread Suren Baghdasaryan
://lore.kernel.org/all/20231006195318.4087158-6-wi...@infradead.org/ Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock") Cc: Matthew Wilcox Signed-off-by: Suren Baghdasaryan --- arch/arm64/mm/fault.c | 2 ++ arch/powerpc/mm/fault.c | 2 ++ arch/riscv/mm/fault.c | 2 ++ ar

Re: [PATCH 1/1] arch/arm/mm: fix major fault accounting when retrying under per-VMA lock

2024-01-25 Thread Suren Baghdasaryan
On Thu, Jan 25, 2024 at 6:04 PM Andrew Morton wrote: > > On Mon, 22 Jan 2024 22:43:05 -0800 Suren Baghdasaryan > wrote: > > > The change [1] missed ARM architecture when fixing major fault accounting > > for page fault retry under per-VMA lock. Add missing code to fix AR

Re: [PATCH 1/1] arch/mm/fault: fix major fault accounting when retrying under per-VMA lock

2024-01-22 Thread Suren Baghdasaryan
On Sun, Jan 21, 2024 at 11:38 PM Suren Baghdasaryan wrote: > > On Sat, Jan 20, 2024 at 1:15 PM Russell King (Oracle) > wrote: > > > > On Sat, Jan 20, 2024 at 09:09:47PM +, > > patchwork-bot+linux-ri...@kernel.org wrote: > > > Hello: > > > &g

[PATCH 1/1] arch/arm/mm: fix major fault accounting when retrying under per-VMA lock

2024-01-22 Thread Suren Baghdasaryan
a1992 ("mm: handle read faults under the VMA lock") Reported-by: Russell King (Oracle) Signed-off-by: Suren Baghdasaryan --- arch/arm/mm/fault.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index e96fb40b9cc3..07565b593ed6 100644 --- a

Re: [PATCH 1/1] arch/mm/fault: fix major fault accounting when retrying under per-VMA lock

2024-01-21 Thread Suren Baghdasaryan
On Sat, Jan 20, 2024 at 1:15 PM Russell King (Oracle) wrote: > > On Sat, Jan 20, 2024 at 09:09:47PM +, > patchwork-bot+linux-ri...@kernel.org wrote: > > Hello: > > > > This patch was applied to riscv/linux.git (fixes) > > by Andrew Morton : > > > > On Tue, 26 Dec 2023 13:46:10 -0800 you

Re: [PATCH 7/7] x86: mm: accelerate pagefault when badaccess

2024-04-03 Thread Suren Baghdasaryan
On Wed, Apr 3, 2024 at 12:58 AM Kefeng Wang wrote: > > > > On 2024/4/3 13:59, Suren Baghdasaryan wrote: > > On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang > > wrote: > >> > >> The vm_flags of vma already checked under per-VMA lock, if it is a > &g

Re: [PATCH 7/7] x86: mm: accelerate pagefault when badaccess

2024-04-03 Thread Suren Baghdasaryan
safe to me. Using (mm != NULL) to indicate that we are holding mmap_lock is not ideal but I guess that works. Reviewed-by: Suren Baghdasaryan > --- > arch/x86/mm/fault.c | 23 ++- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/arch/x86

Re: [PATCH 1/7] arm64: mm: cleanup __do_page_fault()

2024-04-02 Thread Suren Baghdasaryan
On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang wrote: > > The __do_page_fault() only check vma->flags and call handle_mm_fault(), > and only called by do_page_fault(), let's squash it into do_page_fault() > to cleanup code. > > Signed-off-by: Kefeng Wang Reviewed-b

Re: [PATCH 2/7] arm64: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-02 Thread Suren Baghdasaryan
34% in lmbench 'lat_sig -P 1 prot lat_sig'. The change makes sense to me. Per-VMA lock is enough to keep vma->vm_flags stable, so no need to retry with mmap_lock. > > Signed-off-by: Kefeng Wang Reviewed-by: Suren Baghdasaryan > --- > arch/arm64/mm/fault.c | 4 +++- > 1

Re: [PATCH 3/7] arm: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-02 Thread Suren Baghdasaryan
ff-by: Kefeng Wang Reviewed-by: Suren Baghdasaryan > --- > arch/arm/mm/fault.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c > index 439dc6a26bb9..5c4b417e24f9 100644 > --- a/arch/arm/mm/fault.c > ++

Re: [PATCH 2/7] arm64: mm: accelerate pagefault when VM_FAULT_BADACCESS

2024-04-02 Thread Suren Baghdasaryan
On Tue, Apr 2, 2024 at 10:19 PM Suren Baghdasaryan wrote: > > On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang > wrote: > > > > The vm_flags of vma already checked under per-VMA lock, if it is a > > bad access, directly set fault to VM_FAULT_BADACCESS an

Re: [PATCH 4/7] powerpc: mm: accelerate pagefault when badaccess

2024-04-02 Thread Suren Baghdasaryan
On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang wrote: > > The vm_flags of vma already checked under per-VMA lock, if it is a > bad access, directly handle error and return, there is no need to > lock_mm_and_find_vma() and check vm_flags again. > > Signed-off-by: Kefeng Wang Code-wise looks correct

Re: [PATCH 5/7] riscv: mm: accelerate pagefault when badaccess

2024-04-02 Thread Suren Baghdasaryan
On Tue, Apr 2, 2024 at 12:53 AM Kefeng Wang wrote: > > The vm_flags of vma already checked under per-VMA lock, if it is a > bad access, directly handle error and return, there is no need to > lock_mm_and_find_vma() and check vm_flags again. > > Signed-off-by: Kefeng Wang

<    1   2   3   4