From: Peter Xu <peterx@redhat.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Will Deacon <will@kernel.org>, Matt Turner <mattst88@gmail.com>,
linux-s390@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Brian Cain <bcain@quicinc.com>, Borislav Petkov <bp@alien8.de>,
linux-alpha@vger.kernel.org, Alistair Popple <apopple@nvidia.com>,
Jonas Bonn <jonas@southpole.se>,
linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>,
linux-snps-arc@lists.infradead.org,
Vineet Gupta <vgupta@kernel.org>,
Vasily Gorbik <gor@linux.ibm.com>,
Vlastimil Babka <vbabka@suse.cz>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Rich Felker <dalias@li>
Subject: Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types
Date: Mon, 30 May 2022 14:29:31 -0400 [thread overview]
Message-ID: <YpUNC6iGrZRlWMyA@xz-m1.local> (raw)
In-Reply-To: <YpT443jVZtM6p9OD@osiris>
On Mon, May 30, 2022 at 07:03:31PM +0200, Heiko Carstens wrote:
> 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.
Sure thing.
--
Peter Xu
next prev parent reply other threads:[~2022-05-30 18:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 19:39 [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types Peter Xu
2022-05-29 20:33 ` Heiko Carstens
2022-05-30 9:35 ` Christian Borntraeger
2022-05-30 15:52 ` Peter Xu
2022-05-30 16:00 ` Peter Xu
2022-05-30 17:03 ` Heiko Carstens
2022-05-30 18:29 ` Peter Xu [this message]
2022-05-30 18:29 ` Christian Borntraeger
2022-05-30 13:31 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YpUNC6iGrZRlWMyA@xz-m1.local \
--to=peterx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=bcain@quicinc.com \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=dalias@li \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=ink@jurassic.park.msu.ru \
--cc=jonas@southpole.se \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=mattst88@gmail.com \
--cc=mpe@ellerman.id.au \
--cc=stefan.kristiansson@saunalahti.fi \
--cc=vbabka@suse.cz \
--cc=vgupta@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).