Thread (10 messages) 10 messages, 5 authors, 2022-05-30

Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types

From: Heiko Carstens <hca@linux.ibm.com>
Date: 2022-05-30 17:07:51
Also in: linux-alpha, linux-m68k, linux-mips, linux-mm, linux-riscv, linux-s390, linux-sh, linux-um, lkml, sparclinux

r@linux.ibm.com>, linux-parisc@vger.kernel.org, Max Filippov [off-list ref], linux-kernel@vger.kernel.org, Johannes Berg [off-list ref], Dinh Nguyen [off-list ref], linux-riscv@lists.infradead.org, Palmer Dabbelt [off-list ref], Sven Schnelle [off-list ref], linux-alpha@vger.kernel.org, Ivan Kokshaysky [off-list ref], Andrew Morton [off-list ref], Thomas Bogendoerfer [off-list ref], linuxppc-dev@lists.ozlabs.org, "David S . Miller" [off-list ref]
Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org
Sender: "Linuxppc-dev" [off-list ref]

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:
quoted
On Mon, May 30, 2022 at 11:35:10AM +0200, Christian Borntraeger wrote:
quoted
quoted
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;  <----
quoted
quoted
quoted
+		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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help