Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4309136imw; Tue, 12 Jul 2022 05:56:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPJ8CdTuxA7YY/zihYjxFkJWj7Z5qlw+3xtFNcEp/t7qI9xga/x3oi3Sn/zjX2BNE60Fcu X-Received: by 2002:a17:90b:3b8d:b0:1f0:22f1:27d8 with SMTP id pc13-20020a17090b3b8d00b001f022f127d8mr4260026pjb.56.1657630572238; Tue, 12 Jul 2022 05:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657630572; cv=none; d=google.com; s=arc-20160816; b=YYJlFVLo0uJQY7z1U0ddAKQOcRZkfHw50X5CHfly7tZ6RrNa/lXjL1VIoVmya0p65y O1ACBcFWE3QpkEFP/U0qgukLXoxZrAdCz4Fe4561vrPlRMIFQ/ge6aF+OSLwqAUu8/Lc tVVk49hx2RXGMCkiDlimSOQ2jq9+9U5mIjCRJ6COF2hFAPBu1dZ4gF9zIXRI8D786Yn+ lhs75Uad60l3SYReClgRNa6YrsxPYrVRG1puAtN4lhEdYlLad3cv55aW4Vn4AM1HpP4G VNz/IlmvCKQxhIu7DyE3p130XVBSZyLaIdhgEUlRkDXq92QHcuXOjVlFzxEBrfmZTxEb YRNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2N21HTDBIjxWoEIrzQWLXIISwSTkzbIhCdwyPiK7q1o=; b=Xy0BWTmfS21s+0YE9P6XRN78rmz+i52gpWI3Gmyq8jVMG/rWYB+Rbc29K3aK6wLWnK fcgdCjCztMxGChgJXjNY16GMUe3UbpXQ8BIJVWmYYHromZmmx8a9gPy5evQs6warkSdy Xq0IgSm4TjImbbnepnX8r5c7tycLQMiC477vQV+1v+egPSoIxlIGdjSX0gSWFykhX9SO oo9/oooEK7Gje4hdolyCtcLMxgSL8TUSpDH+kYO/ytlOW0EBLGX7W/1nFUh/BdWMVWwz QXCNdVqvD72N8Sb93+6y3fCt2RqP6Ozc0eFL8/3D2dtg78cYqx/L0OJC6YnshFGXS8/X g5RA== 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 x189-20020a6386c6000000b00415ef8c15f1si9216275pgd.486.2022.07.12.05.55.57; Tue, 12 Jul 2022 05:56:12 -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 S229634AbiGLMIv (ORCPT + 99 others); Tue, 12 Jul 2022 08:08:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbiGLMIs (ORCPT ); Tue, 12 Jul 2022 08:08:48 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E87A658F; Tue, 12 Jul 2022 05:08:45 -0700 (PDT) Received: from [10.180.13.185] (unknown [10.180.13.185]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxv9BLZM1iC0kZAA--.15930S3; Tue, 12 Jul 2022 20:08:43 +0800 (CST) Subject: Re: [PATCH] MIPS: fix pmd_mkinvalid To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org References: <1657181495-33004-1-git-send-email-zhanghongchen@loongson.cn> <20220707092206.GA9894@alpha.franken.de> <0fd4e823-493f-07f0-08d5-f4a22491b602@loongson.cn> <20220712111917.GA10936@alpha.franken.de> From: Hongchen Zhang Message-ID: Date: Tue, 12 Jul 2022 20:08:43 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20220712111917.GA10936@alpha.franken.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9Dxv9BLZM1iC0kZAA--.15930S3 X-Coremail-Antispam: 1UD129KBjvJXoW7Ar17XF15Ww1DCr18ury7GFg_yoW8tr47pF Z5tF1UtFWDtrn7Jr18Kr18JFyYyw15tw15Wrn5JF1UA392qr1Iqr4UX390934UXF4kGr1U tF45XasrZw1UAaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv0b7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1cAE67vIY487MxkI ecxEwVCm-wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F4 0E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1l IxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxV AFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_ Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU5 PpnJUUUUU== X-CM-SenderInfo: x2kd0w5krqwupkhqwqxorr0wxvrqhubq/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,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 2022/7/12 下午7:19, Thomas Bogendoerfer wrote: > 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. > Hi Thomas, Thanks for your patiently review. For your question, 1. I think there may be problem when compile 32bit kernel with huge page support,because _PAGE_HUGE_SHIFT is only defined for R4K now. 2. I will modify the commit as you said and make a v2 patch. Thanks. Hongchen Zhang