lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YpTqNKMTt8PoA41n@xz-m1.local>
Date:   Mon, 30 May 2022 12:00:52 -0400
From:   Peter Xu <peterx@...hat.com>
To:     Christian Borntraeger <borntraeger@...ux.ibm.com>
Cc:     Heiko Carstens <hca@...ux.ibm.com>, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, Will Deacon <will@...nel.org>,
        Matt Turner <mattst88@...il.com>, linux-s390@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Brian Cain <bcain@...cinc.com>, Borislav Petkov <bp@...en8.de>,
        linux-alpha@...r.kernel.org, Alistair Popple <apopple@...dia.com>,
        Jonas Bonn <jonas@...thpole.se>,
        linux-arm-kernel@...ts.infradead.org, linux-ia64@...r.kernel.org,
        Michael Ellerman <mpe@...erman.id.au>,
        Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
        linux-snps-arc@...ts.infradead.org,
        Vineet Gupta <vgupta@...nel.org>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Ivan Kokshaysky <ink@...assic.park.msu.ru>,
        Rich Felker <dalias@...c.org>, sparclinux@...r.kernel.org,
        Russell King <linux@...linux.org.uk>,
        David Hildenbrand <david@...hat.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Nicholas Piggin <npiggin@...il.com>,
        "James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
        linux-xtensa@...ux-xtensa.org, linux-sh@...r.kernel.org,
        Paul Walmsley <paul.walmsley@...ive.com>,
        linux-m68k@...ts.linux-m68k.org, linuxppc-dev@...ts.ozlabs.org,
        Richard Henderson <rth@...ddle.net>,
        Guo Ren <guoren@...nel.org>, linux-parisc@...r.kernel.org,
        Andrea Arcangeli <aarcange@...hat.com>,
        Helge Deller <deller@....de>,
        Al Viro <viro@...iv.linux.org.uk>,
        Albert Ou <aou@...s.berkeley.edu>,
        linux-um@...ts.infradead.org, "H . Peter Anvin" <hpa@...or.com>,
        Janosch Frank <frankja@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Anton Ivanov <anton.ivanov@...bridgegreys.com>,
        openrisc@...ts.librecores.org,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        linux-hexagon@...r.kernel.org, Andy Lutomirski <luto@...nel.org>,
        Stafford Horne <shorne@...il.com>, linux-csky@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-mips@...r.kernel.org, Paul Mackerras <paulus@...ba.org>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Dinh Nguyen <dinguyen@...nel.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        "David S . Miller" <davem@...emloft.net>,
        Johannes Weiner <hannes@...xchg.org>,
        Hugh Dickins <hughd@...gle.com>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-riscv@...ts.infradead.org, Max Filippov <jcmvbkbc@...il.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Johannes Berg <johannes@...solutions.net>,
        Chris Zankel <chris@...kel.net>,
        Michal Simek <monstr@...str.eu>, x86@...nel.org,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Richard Weinberger <richard@....at>,
        Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared
 memory types

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:
> > 
> > 
> > Am 29.05.22 um 22:33 schrieb Heiko Carstens:
> > [...]
> > > 
> > > Guess the patch below on top of your patch is what we want.
> > > Just for clarification: if gmap is not NULL then the process is a kvm
> > > process. So, depending on the workload, this optimization makes sense.
> > > 
> > > 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;
> > > +		}
> > > +		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,

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ