Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4233098imw; Tue, 12 Jul 2022 04:33:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tNrFDRMrugXmt4/3UIQ6/rP1TgUcz7N7H0TWxGXPWHuyHmqdYMEVIVGPeEkB7BG2H8gIAf X-Received: by 2002:a63:5363:0:b0:40d:7f8d:370c with SMTP id t35-20020a635363000000b0040d7f8d370cmr20466709pgl.216.1657625588542; Tue, 12 Jul 2022 04:33:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657625588; cv=none; d=google.com; s=arc-20160816; b=qFCsSxTPj5llAi+9AfNdbSpEPIBo3ctJMv9n2jmJn54sgLOU/7DcHxVs2gVoBmTL44 USsI83uQinY7JYTJAq+luL19urbsJS6ru21de9XyuyETSwCVMFLho/+Tauj53yjhSqNI aBFRc9uwDmWuFBsSwj3PikFvpClOpQFbo5L00TZhS8fgXIXsS5p+QVo/NiokXHuQ4GgR dceNfrhOT3sCr6p/w6MPA+21Q3h5KIXzNOYFdOM/nj8ofo6v+Mjx6uvRdPJuQtjP6uVm nU4rp6VvNO/BxXNRAScEJYXpGm8YlH3DdB7gS+NjPnm7JCW61BAOmWSDV3HKCYonWA5Y 8+ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EoUGjxT3ulcQK4g6HB+cz3RbRVP6WWX809g1If0pFlY=; b=GHSdxkh8PdToQMbTkhsyVF7W9VpHtMSpM1wldYfgw40RU0UGnDQFZyX7zibSSfiga0 2wA2G8erG+L1WT40srCDeCvqH+QnUDObqF5ce3SNzKiEfejmFhVrThzZBQQwmrCDe0BF 5FtdBp830QJ1QcIVK+YLD0weE+wZNSLLxm7g6rqWz+lQeh3g2cfIE7K9xhk5XqLRnzWW upmVz5++24Kpo+T+iHtmIMz4BCBYkq/FYXy+L+soucUYH+E4paec3NmWD9m+6AFqo/l2 bVuqif29Dn0FhpOxcThs/uLUpYWYXvc41ff6El767JAU1ARYN8Vc2+7dJEnNgZjq0Iy7 Vh7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a170902f54100b0016a1f216aedsi15674193plf.226.2022.07.12.04.32.54; Tue, 12 Jul 2022 04:33:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbiGLL3k (ORCPT + 99 others); Tue, 12 Jul 2022 07:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiGLL3g (ORCPT ); Tue, 12 Jul 2022 07:29:36 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 13B27193DF; Tue, 12 Jul 2022 04:29:35 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1oBE58-00025x-00; Tue, 12 Jul 2022 13:29:34 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id E75EEC036A; Tue, 12 Jul 2022 13:19:17 +0200 (CEST) Date: Tue, 12 Jul 2022 13:19:17 +0200 From: Thomas Bogendoerfer To: Hongchen Zhang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: fix pmd_mkinvalid Message-ID: <20220712111917.GA10936@alpha.franken.de> References: <1657181495-33004-1-git-send-email-zhanghongchen@loongson.cn> <20220707092206.GA9894@alpha.franken.de> <0fd4e823-493f-07f0-08d5-f4a22491b602@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0fd4e823-493f-07f0-08d5-f4a22491b602@loongson.cn> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Jul 12, 2022 at 06:01:08PM +0800, Hongchen Zhang wrote: > On 2022/7/7 下午7:12, Hongchen Zhang wrote: > > On 2022/7/7 下午5:22, Thomas Bogendoerfer wrote: > > > On Thu, Jul 07, 2022 at 04:11:35PM +0800, Hongchen Zhang wrote: > > > > When a pmd entry is invalidated by pmd_mkinvalid,pmd_present should > > > > return true. > > > > So introduce a _PMD_PRESENT_INVALID_SHIFT bit to check if a pmd is > > > > present but invalidated by pmd_mkinvalid. > > > > > > What problem are you trying to fix ? What are the symptoms ? > > > > > > > Reported-by: kernel test robot > > > > > > the test robot showed problems with your last version of the patch, > > > which hasn't been integrated into at least the MIPS tree, so no > > > need to that. > > > > > > Thomas. > > > > > > > Hi Thomas, > >   The idea come from the commit: > >   b65399f6111b(arm64/mm: Change THP helpers to comply with generic MM > >  semantics). > >   There is an problem now: > >         CPU 0        CPU 1 > >     pmdp_invalidate        do_page_fault > >     ...              __handle_mm_fault > >                     is_swap_pmd == true > >                     trigger VM_BUG_ON() ? > >     set_pmd_at > >   the reason is that pmd_present return true,after this commit > >   pmd_present will return false,and the VM_BUG_ON will not be triggered. > >   Like arm64 does,we can introduce a new bit to fix this. > > > > Thanks. > Hi Thomas, > Is there problem of this patch? What's your opinion of this patch? I haven't dig deeper into it, but needing more page bits is a pain for 32bit kernel and would make it nearly impossible to get huge page support there. And the description you gave me, needs to be in the commit description. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]