From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4CC4C83F11 for ; Sat, 26 Aug 2023 01:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231183AbjHZBH0 (ORCPT ); Fri, 25 Aug 2023 21:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbjHZBHI (ORCPT ); Fri, 25 Aug 2023 21:07:08 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8E7826B9; Fri, 25 Aug 2023 18:07:04 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RXdsj5kCdz1L9Gp; Sat, 26 Aug 2023 09:05:29 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 26 Aug 2023 09:07:01 +0800 Message-ID: <2e047e5a-d833-4c6b-8b7c-85d29e19ceed@huawei.com> Date: Sat, 26 Aug 2023 09:07:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH rfc v2 04/10] s390: mm: use try_vma_locked_page_fault() Content-Language: en-US To: Heiko Carstens , Alexander Gordeev CC: Andrew Morton , , , , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Gerald Schaefer , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , , "H . Peter Anvin" , , , , , , References: <20230821123056.2109942-1-wangkefeng.wang@huawei.com> <20230821123056.2109942-5-wangkefeng.wang@huawei.com> <20230824083225.10112-A-hca@linux.ibm.com> From: Kefeng Wang In-Reply-To: <20230824083225.10112-A-hca@linux.ibm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On 2023/8/24 16:32, Heiko Carstens wrote: > On Thu, Aug 24, 2023 at 10:16:33AM +0200, Alexander Gordeev wrote: >> On Mon, Aug 21, 2023 at 08:30:50PM +0800, Kefeng Wang wrote: >>> Use new try_vma_locked_page_fault() helper to simplify code. >>> No functional change intended. >>> >>> Signed-off-by: Kefeng Wang >>> --- >>> arch/s390/mm/fault.c | 66 ++++++++++++++++++-------------------------- >>> 1 file changed, 27 insertions(+), 39 deletions(-) > ... >>> - fault = handle_mm_fault(vma, address, flags | FAULT_FLAG_VMA_LOCK, regs); >>> - if (!(fault & (VM_FAULT_RETRY | VM_FAULT_COMPLETED))) >>> - vma_end_read(vma); >>> - if (!(fault & VM_FAULT_RETRY)) { >>> - count_vm_vma_lock_event(VMA_LOCK_SUCCESS); >>> - if (likely(!(fault & VM_FAULT_ERROR))) >>> - fault = 0; >> >> This fault fixup is removed in the new version. > ... > >>> + vmf.vm_flags = VM_WRITE; >>> + if (vmf.vm_flags == VM_WRITE) >>> + vmf.flags |= FAULT_FLAG_WRITE; >>> + >>> + fault = try_vma_locked_page_fault(&vmf); >>> + if (fault == VM_FAULT_NONE) >>> + goto lock_mm; >> >> Because VM_FAULT_NONE is set to 0 it gets confused with >> the success code of 0 returned by a fault handler. In the >> former case we want to continue, while in the latter - >> successfully return. I think it applies to all archs. > ... >> FWIW, this series ends up with kernel BUG at arch/s390/mm/fault.c:341! > I didn't test and only built, this is a RFC to want to know whether the way to add three more numbers into vmf and using vmf in arch's page fault is feasible or not. > Without having looked in detail into this patch: all of this is likely > because s390's fault handling is quite odd. Not only because fault is set > to 0, but also because of the private VM_FAULT values like > VM_FAULT_BADCONTEXT. I'm just cleaning up all of this, but it won't make it > for the next merge window. Sure, if re-post, will drop the s390's change, but as mentioned above, the abstract of the generic vma locked and changes may be not perfect, let's wait for more response. Thanks all. > > Therefore I'd like to ask to drop the s390 conversion of this series, and > if this series is supposed to be merged the s390 conversion needs to be > done later. Let's not waste more time on the current implementation, > please.