diff mbox series

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

Message ID 20240123064305.2829244-1-surenb@google.com (mailing list archive)
State Accepted
Commit e870920bbe68e52335a4c31a059e6af6a9a59dbb
Headers show
Series [1/1] arch/arm/mm: fix major fault accounting when retrying under per-VMA lock | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-1-test-6 warning .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-1-test-11 fail .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Suren Baghdasaryan Jan. 23, 2024, 6:43 a.m. UTC
The change [1] missed ARM architecture when fixing major fault accounting
for page fault retry under per-VMA lock. Add missing code to fix ARM
architecture fault accounting.

[1] 46e714c729c8 ("arch/mm/fault: fix major fault accounting when retrying under per-VMA lock")

Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock")

Reported-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
---
 arch/arm/mm/fault.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andrew Morton Jan. 26, 2024, 2:04 a.m. UTC | #1
On Mon, 22 Jan 2024 22:43:05 -0800 Suren Baghdasaryan <surenb@google.com> 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 ARM
> architecture fault accounting.
> 
> [1] 46e714c729c8 ("arch/mm/fault: fix major fault accounting when retrying under per-VMA lock")
> 
> Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock")

What are the userspace-visible runtime effects of this change?

Is a cc:stable backport desirable?

> Reported-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Suren Baghdasaryan Jan. 26, 2024, 2:19 a.m. UTC | #2
On Thu, Jan 25, 2024 at 6:04 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Mon, 22 Jan 2024 22:43:05 -0800 Suren Baghdasaryan <surenb@google.com> 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 ARM
> > architecture fault accounting.
> >
> > [1] 46e714c729c8 ("arch/mm/fault: fix major fault accounting when retrying under per-VMA lock")
> >
> > Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock")
>
> What are the userspace-visible runtime effects of this change?

The user-visible effects is that it restores correct major fault
accounting that was broken after [2] was merged in 6.7 kernel. The
more detailed description is in [3] and this patch simply adds the
same fix to ARM architecture which I missed in [3]. I can re-send the
patch with the full description from [3] if needed.

>
> Is a cc:stable backport desirable?

Yes, I guess since [2] was merged in 6.7, cc-ing stable would be desirable.
Please let me know if you want me to re-send the patch with full
description and CC'ing stable.

[2] https://lore.kernel.org/all/20231006195318.4087158-6-willy@infradead.org/
[3] https://lore.kernel.org/all/20231226214610.109282-1-surenb@google.com/

>
> > Reported-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > Signed-off-by: Suren Baghdasaryan <surenb@google.com>
patchwork-bot+linux-riscv@kernel.org March 25, 2024, 4:42 a.m. UTC | #3
Hello:

This patch was applied to riscv/linux.git (fixes)
by Andrew Morton <akpm@linux-foundation.org>:

On Mon, 22 Jan 2024 22:43:05 -0800 you 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 ARM
> architecture fault accounting.
> 
> [1] 46e714c729c8 ("arch/mm/fault: fix major fault accounting when retrying under per-VMA lock")
> 
> Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock")
> 
> [...]

Here is the summary with links:
  - [1/1] arch/arm/mm: fix major fault accounting when retrying under per-VMA lock
    https://git.kernel.org/riscv/c/e870920bbe68

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index e96fb40b9cc3..07565b593ed6 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -298,6 +298,8 @@  do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
 		goto done;
 	}
 	count_vm_vma_lock_event(VMA_LOCK_RETRY);
+	if (fault & VM_FAULT_MAJOR)
+		flags |= FAULT_FLAG_TRIED;
 
 	/* Quick path to respond to signals */
 	if (fault_signal_pending(fault, regs)) {