Re: Possible duplicate page fault accounting on some archs after commit 4064b9827063
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Gerald Schaefer <gerald.schaefer@xxxxxxxxxx>
- Subject: Re: Possible duplicate page fault accounting on some archs after commit 4064b9827063
- From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 10 Jun 2020 09:53:49 -0700
- Cc: Peter Xu <peterx@xxxxxxxxxx>, linux-arch <linux-arch@xxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, alpha <linux-alpha@xxxxxxxxxxxxxxx>, Linux ARM <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k <linux-m68k@xxxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, linux-mips@xxxxxxxxxxxxxxx, Nick Hu <nickhu@xxxxxxxxxxxxx>, Ley Foon Tan <ley.foon.tan@xxxxxxxxx>, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, Linux-sh list <linux-sh@xxxxxxxxxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, linux-um <linux-um@xxxxxxxxxxxxxxxxxxx>, Guan Xuetao <gxt@xxxxxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, Andrea Arcangeli <aarcange@xxxxxxxxxx>
- In-reply-to: <20200610174811.44b94525@thinkpad>
- References: <20200610174811.44b94525@thinkpad>
On Wed, Jun 10, 2020 at 8:48 AM Gerald Schaefer
<gerald.schaefer@xxxxxxxxxx> wrote:
>
> This was found by coincidence in s390 code, and a quick check showed that
> there are quite a lot of other architectures that seem to be affected in a
> similar way. I'm preparing a fix for s390, by moving the accounting behind
> the retry loop, similar to x86. It is not completely straight-forward, so
> I leave the fix for other archs to the respective maintainers.
Hmm. I wonder if we could move the handling into handle_mm_fault() itself.
It's _fairly_ trivial to do on the arch side, just as long as you
remember to make the VM_FAULT_MAJOR bit sticky like x86 does with that
major |= fault & VM_FAULT_MAJOR;
right after handle_mm_fault(). But it certainly doesn't seem like it
would be hard to move into common code in handle_mm_fault() either, by
just not doing the accounting if it's about to return VM_FAULT_RETRY
or VM_FAULT_ERROR.
That said, we want that perf_sw_event() accounting too, so we'd have
to pass in a 'struct regs *' as well. And it's not clear which way
accounting should go for other callers of handle_mm_fault() (ie gup
etc).
So I guess just having architectures fix it up individually and make
sure they don't do it for retry conditions is the right thing to do..
Linus
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]