Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93E6B37F for ; Sat, 26 Aug 2023 01:07:11 +0000 (UTC) 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 Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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.