Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1276313lfc; Wed, 1 Jun 2022 13:56:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4rpgKPSOp5MDdExdoydbAJW4UqJPE+u1DenKzajCf+Vg3+fg79Dhiih83vhjFC6GCNqbQ X-Received: by 2002:a05:6a00:996:b0:50b:76b8:3bb1 with SMTP id u22-20020a056a00099600b0050b76b83bb1mr1463094pfg.9.1654117001592; Wed, 01 Jun 2022 13:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654117001; cv=none; d=google.com; s=arc-20160816; b=JGtCPjQs2wIaSX0Cr5O6TRLHN4YhEhd/bN8XhlR221FUQRAymU6BUQyWfFaE6SKWjs T61R94yNoSUesLhIquzqo99qIXmIbA+ALu1lVluez3o1mDiTAM/fgB8H7R4vKw9Xb+xC vi9zpJt+DFY+9uKwAa3oik6u2aeTQjOWXRCAw1d/A5LalUBhg1BUVfsp7k6hFa8nevOn gHJL3HrbIvCwXsAUeX5fY1COCGU4hNXSoTuQP/r2Uq2uFxlfRXxebAgqmFo5kGzCLiYg CHE+qkWS2C+0c7RIm86mj0JKMlReCED1/HruVO6090E7+MOEecAqGpv2JBe3o2lEVCUQ OdWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nuAd2Iic3Df8wQVQfUDAHr9blMnTlV35ZZhowW5zRHM=; b=0vqj8IaK1l1VEZ/O5+GiGw8cqemIEX9ecM92+il3G083VDgacojtJdULUg+erlXst1 DUZRhl5a6NMDx2uSLrVFwOJG/LO7tPsepbJizmvV4owqrol3cUVG7xEFnsn3OHF9nkmJ Rh0hDulyYa7eAUmCsVNYRJi2UCfX34i8isPlqXO+rKEDgIUoWK7PvmSE3SPCk3n7p/gx 4Qof4P72gOhWue18PVuaOzJe+IGE+AriBrB7z503wGk9KzTcLD7cLbgsFJavZqSq6fSf /+GAQmvso+jUSqv+wZL2Jnl7IZn1AcmXjL8QnjFPGxI38s5ee3Rcf6L/Mvs3atE0zjEz cnrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GwoxnpVH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p188-20020a62d0c5000000b0050df0383302si3196738pfg.255.2022.06.01.13.56.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:56:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GwoxnpVH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E95620C270; Wed, 1 Jun 2022 12:57:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240960AbiE3RGx (ORCPT + 99 others); Mon, 30 May 2022 13:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231479AbiE3RGt (ORCPT ); Mon, 30 May 2022 13:06:49 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE7E313D1D; Mon, 30 May 2022 10:06:48 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24UFlBCJ006896; Mon, 30 May 2022 17:03:42 GMT 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== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gd0tt94te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 17:03:42 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24UH0Sno010210; Mon, 30 May 2022 17:03:41 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gd0tt94st-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 17:03:40 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24UH30XB023868; Mon, 30 May 2022 17:03:38 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 3gbbynk0ju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 17:03:38 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24UGnEMM55837084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 May 2022 16:49:14 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E56C9A4054; Mon, 30 May 2022 17:03:34 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 75192A405C; Mon, 30 May 2022 17:03:32 +0000 (GMT) Received: from osiris (unknown [9.145.46.13]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 30 May 2022 17:03:32 +0000 (GMT) Date: Mon, 30 May 2022 19:03:31 +0200 From: Heiko Carstens 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 , sparclinux@vger.kernel.org, Russell King , David Hildenbrand , Benjamin Herrenschmidt , Nicholas Piggin , "James E . J . Bottomley" , linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, Paul Walmsley , linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, Richard Henderson , Guo Ren , linux-parisc@vger.kernel.org, Andrea Arcangeli , Helge Deller , Al Viro , Albert Ou , linux-um@lists.infradead.org, "H . Peter Anvin" , Janosch Frank , Sven Schnelle , Anton Ivanov , openrisc@lists.librecores.org, Thomas Bogendoerfer , linux-hexagon@vger.kernel.org, Andy Lutomirski , Stafford Horne , linux-csky@vger.kernel.org, Thomas Gleixner , linux-mips@vger.kernel.org, Paul Mackerras , Alexander Gordeev , Dinh Nguyen , Palmer Dabbelt , "David S . Miller" , Johannes Weiner , Hugh Dickins , Ingo Molnar , Peter Zijlstra , linux-riscv@lists.infradead.org, Max Filippov , Catalin Marinas , Geert Uytterhoeven , Johannes Berg , Chris Zankel , Michal Simek , x86@kernel.org, Yoshinori Sato , Dave Hansen , Richard Weinberger , Ingo Molnar Subject: Re: [PATCH v4] mm: Avoid unnecessary page fault retires on shared memory types Message-ID: References: <20220527193936.30678-1-peterx@redhat.com> <33fd4731-9765-d78b-bdc3-f8243c98e81f@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: kj3ykjw07xL7ladYmzasaLdz4r7OyUPU X-Proofpoint-GUID: UnBEcQZR6mYYZGFfUgye1q-aXjSM4e8h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-05-30_07,2022-05-30_03,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 phishscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205300090 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.