Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Peter Xu <peterx@xxxxxxxxxx>
- Subject: Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types
- From: Heiko Carstens <hca@xxxxxxxxxxxxx>
- Date: Mon, 30 May 2022 19:03:31 +0200
- Cc: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, Will Deacon <will@xxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, linux-s390@xxxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Brian Cain <bcain@xxxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, Alistair Popple <apopple@xxxxxxxxxx>, Jonas Bonn <jonas@xxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Stefan Kristiansson <stefan.kristiansson@xxxxxxxxxxxxx>, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, Vineet Gupta <vgupta@xxxxxxxxxx>, Vasily Gorbik <gor@xxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>, sparclinux@xxxxxxxxxxxxxxx, Russell King <linux@xxxxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, "James E . J . Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, Paul Walmsley <paul.walmsley@xxxxxxxxxx>, linux-m68k@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, Richard Henderson <rth@xxxxxxxxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, linux-parisc@xxxxxxxxxxxxxxx, Andrea Arcangeli <aarcange@xxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Albert Ou <aou@xxxxxxxxxxxxxxxxx>, linux-um@xxxxxxxxxxxxxxxxxxx, "H . Peter Anvin" <hpa@xxxxxxxxx>, Janosch Frank <frankja@xxxxxxxxxxxxx>, Sven Schnelle <svens@xxxxxxxxxxxxx>, Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>, openrisc@xxxxxxxxxxxxxxxxxxxx, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, linux-hexagon@xxxxxxxxxxxxxxx, Andy Lutomirski <luto@xxxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, linux-csky@xxxxxxxxxxxxxxx, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, linux-mips@xxxxxxxxxxxxxxx, Paul Mackerras <paulus@xxxxxxxxx>, Alexander Gordeev <agordeev@xxxxxxxxxxxxx>, Dinh Nguyen <dinguyen@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, Johannes Weiner <hannes@xxxxxxxxxxx>, Hugh Dickins <hughd@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, linux-riscv@xxxxxxxxxxxxxxxxxxx, Max Filippov <jcmvbkbc@xxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Johannes Berg <johannes@xxxxxxxxxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, x86@xxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>
- In-reply-to: <YpTqNKMTt8PoA41n@xz-m1.local>
- References: <20220527193936.30678-1-peterx@redhat.com> <YpPYkzbrQmy4FjrI@osiris> <33fd4731-9765-d78b-bdc3-f8243c98e81f@linux.ibm.com> <YpToVpjXmdFqGOpY@xz-m1.local> <YpTqNKMTt8PoA41n@xz-m1.local>
On Mon, May 30, 2022 at 12:00:52PM -0400, Peter Xu wrote:
> On Mon, May 30, 2022 at 11:52:54AM -0400, Peter Xu wrote:
> > On Mon, May 30, 2022 at 11:35:10AM +0200, Christian Borntraeger wrote:
> > > > diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
> > > > index 4608cc962ecf..e1d40ca341b7 100644
> > > > --- a/arch/s390/mm/fault.c
> > > > +++ b/arch/s390/mm/fault.c
> > > > @@ -436,12 +436,11 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access)
> > > > /* The fault is fully completed (including releasing mmap lock) */
> > > > if (fault & VM_FAULT_COMPLETED) {
> > > > - /*
> > > > - * Gmap will need the mmap lock again, so retake it. TODO:
> > > > - * only conditionally take the lock when CONFIG_PGSTE set.
> > > > - */
> > > > - mmap_read_lock(mm);
> > > > - goto out_gmap;
> > > > + if (gmap) {
> > > > + mmap_read_lock(mm);
> > > > + goto out_gmap;
> > > > + }
fault = 0; <----
> > > > + goto out;
>
> Hmm, right after I replied I found "goto out" could be problematic, since
> all s390 callers of do_exception() will assume it an error condition (side
> note: "goto out_gmap" contains one step to clear "fault" to 0). I'll
> replace this with "return 0" instead if it looks good to both of you.
>
> I'll wait for a confirmation before reposting. Thanks,
Right, that was stupid. Thanks for double checking!
However could you please add "fault = 0" just in front of the goto out
like above? I'd like to avoid having returns and gotos mixed.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]