Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1037030iol; Thu, 9 Jun 2022 21:36:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDxtqcE8bITHn1t8+GJ16A6b9TxE7Udu8C/s5XfOaFeLkB2k/kIg9GnvsQCjsIDE408cQu X-Received: by 2002:a63:8142:0:b0:3fc:c051:167f with SMTP id t63-20020a638142000000b003fcc051167fmr38223368pgd.384.1654835781829; Thu, 09 Jun 2022 21:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654835781; cv=none; d=google.com; s=arc-20160816; b=EnFYLR39qRFkc9CdmMh1lkAQxLervJNeui2eit6knjrzWGYIJvHuc3iJ5XLtFbZvR2 8k8RwC4aO/5DbeHw3pcHnp1ecm6k6nrZ4k3npQNeHfz8RXahd7qYrPxxLQGRlyUyX08f CHeZbRm79rtN4IWISIm0XE6i3KRFwaeDyRhBPyCMvzjBACwLaYY3JYuwklJ3TMLHmMd5 sLlMFQj7XW2wYPt6XogLG9DvhEZwOApAZomT2PCNH2WvGlQHKuKU6f9cNd9kc4UTGan8 WHM3ahieNLOVJBmJBiTlWmTv7Qkoni3I7dRydBWlvYxsEDqw/LWAFs5r66j8vdwONLtB wR4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=8mq78KgNUL1o/LoRDwg4C41Vd5CATK8kfCF4aI0DymQ=; b=dScWTZIAUj+/3XVM0YZadsPrpUgO8AoZ/ImrpGkRbSxzR8m2jRNFSDzfbY0YA3Qpwj NeH1qFRiVhWQ2cQym72AiRZfDsS5roiwEXBrQW+PlH3sgoVLaCVMvml0ybZZVSBNXjE8 ribiBr2MSoLM3m3+DiuR+1cDphLxImtDa/yb7tsF6aZpoOIeyeLUM6rQxvbDFu3eVt6l 93TbPOC8WaGsKZgQJjiDqOpVQDIszXvGiU2wqzC4+eHzobyVW609c7P69xEheLI9Iy+o hi8uO/xbmEEnGn4qIM+ashZFUJ8cwR96Sb+9Fkm24vmwj1P0+k0143ywSaWcIJKzFjJW P6+w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a056a000c8100b0051bbbc5f0aasi35350440pfv.261.2022.06.09.21.36.07; Thu, 09 Jun 2022 21:36:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239219AbiFJD7W (ORCPT + 99 others); Thu, 9 Jun 2022 23:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346587AbiFJD6s (ORCPT ); Thu, 9 Jun 2022 23:58:48 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABD0245792; Thu, 9 Jun 2022 20:58:47 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R861e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VFxazjx_1654833523; Received: from 30.0.143.52(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VFxazjx_1654833523) by smtp.aliyun-inc.com; Fri, 10 Jun 2022 11:58:44 +0800 Message-ID: <6351ead6-b4b8-dc43-2c1d-c099094cadc9@linux.alibaba.com> Date: Fri, 10 Jun 2022 11:58:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [mm] 9b12e49e9b: BUG:Bad_page_state_in_process To: Matthew Wilcox Cc: kernel test robot , 0day robot , LKML , linux-csky@vger.kernel.org, openrisc@lists.librecores.org, linux-arch@vger.kernel.org, lkp@lists.01.org, akpm@linux-foundation.org, linux-mm@kvack.org References: <20220608143819.GA31193@xsang-OptiPlex-9020> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 6/9/2022 8:18 PM, Matthew Wilcox wrote: > On Thu, Jun 09, 2022 at 12:42:16PM +0800, Baolin Wang wrote: >> diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c >> index 6cccf52e156a..cae74e972426 100644 >> --- a/arch/x86/mm/pgtable.c >> +++ b/arch/x86/mm/pgtable.c >> @@ -858,6 +858,7 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) >> /* INVLPG to clear all paging-structure caches */ >> flush_tlb_kernel_range(addr, addr + PAGE_SIZE-1); >> >> + pgtable_clear_and_dec(virt_to_page(pte)); >> free_page((unsigned long)pte); >> >> return 1; > > If you're going to call virt_to_page() here, you may as well cache the > result and call __free_page(page) to avoid calling virt_to_page() twice. Right, will do in next version. Thanks.