From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Carstens Subject: Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types Date: Mon, 30 May 2022 19:03:31 +0200 Message-ID: References: <20220527193936.30678-1-peterx@redhat.com> <33fd4731-9765-d78b-bdc3-f8243c98e81f@linux.ibm.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=nuAd2Iic3Df8wQVQfUDAHr9blMnTlV35ZZhowW5zRHM=; b=GwoxnpVHH+XSUsQX4Uo1bo8cdnbuzO0NJnzuyE90Jasb+aOQ71mVN8kYNbpcdUCKt9gZ 5/2tRl0m5i0yJ0QvpW5ewhK5WrTrZDG3u1FvMAGm/mp6Uhg2yCEioInqh158ShVbgQZd VOv6o2bJzN7/DpdevufU/c6bjaulj3jTXyZkX+N1v9KthdoxZL1VEwGdXUYdM0uPqRBG PH1Mc3zn+iFNHwQX2MgC9zkNQZ5S1v3/u9cv0MoSSUerYaf0eezVaPl4xU8E4/tUMsEF or8tsa1h/KQuioEysfZ4L5FhMQ5/D9Nb/sP/1EISoxs5arGd7XvXiAOqZeEBT/RamGym vg== Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Peter Xu Cc: Christian Borntraeger , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Will Deacon , Matt Turner , linux-s390@vger.kernel.org, Andrew Morton , Brian Cain , Borislav Petkov , linux-alpha@vger.kernel.org, Alistair Popple , Jonas Bonn , linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, Michael Ellerman , Stefan Kristiansson , linux-snps-arc@lists.infradead.org, Vineet Gupta , Vasily Gorbik , Vlastimil Babka , Ivan Kokshaysky , Rich Felker 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.