Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp400312iol; Thu, 9 Jun 2022 06:12:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS2i5lqoGiwBTMZMz6t+Rh/FxKbZ5hAoxv3zHssAUKCKrsy6ucV9dQMabCAOwFfL6uVGDA X-Received: by 2002:a05:6402:3227:b0:42d:df54:ba24 with SMTP id g39-20020a056402322700b0042ddf54ba24mr44789140eda.49.1654780331587; Thu, 09 Jun 2022 06:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654780331; cv=none; d=google.com; s=arc-20160816; b=KaJLxeFWIx6LzjgH5ewU8qJAkMWaafFBdF7rx2rEEED1Og3wXd9nQCcXSK6pq8Osjf x+iZ0FcR6ETeQroXqjVPCudPGGIO2+3RcIzOGIpNIy0qRYMRfjLhHpwjSdODGf++0mQi VuPYKCeAxrWPJFENTxBTXVERdLGst1g3+R6luigpMDQivo+z/CKsgwgoi3wyb91RLdmr +usiihvB6OooTWxG08LniAeJnqvohH4hIoLaHSR09SyZziFxUzZwOHRd+XB4s4520gnc fWi3drjmJfWy6fpS0cJb9uSotuwQy7lIxzaYilwrjPvFEI3fZpVU6XWBkwD6DPhMAFX/ IHqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1Py1XbeQYoV2WaLT1b7PoYSfrJY33ukYR++1ZCekWrA=; b=qZ4htVujWEWc0s9reDWJY/FUTGamjdFNgiUiQobqSLAZcxCEGzWtK39CLw2wZaSwUH 2RXKSQrG2Fvqn3cK32BadJmUQdq5WKluUCPOp87gAwntu69vAlr/Dyt9+hP1f53B2hXA vStx6Rouk0CF5tH5q3f3Basfmj1SJ/Ir2WQceqgSpXIf8tdyqE9WYvpTtAXNbGT5DfPg hXN1xNUKkcp3HVlYQXg6ALj33rx1XMEOR7tIve5OXAchs0UAIiYecizSRVOdEtEq2twK J8B1ZgvG/bf25buBOfw4HWjh1KBUlpDn1GF6QQjfN0h1eTPStCF2a4eodLpZnPLaC73l EFeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d5SJnp5L; 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 sd22-20020a1709076e1600b00702d8bd9e13si2836901ejc.707.2022.06.09.06.11.37; Thu, 09 Jun 2022 06:12:11 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=d5SJnp5L; 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 S245342AbiFIMTS (ORCPT + 99 others); Thu, 9 Jun 2022 08:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245344AbiFIMTL (ORCPT ); Thu, 9 Jun 2022 08:19:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AD431BC149; Thu, 9 Jun 2022 05:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1Py1XbeQYoV2WaLT1b7PoYSfrJY33ukYR++1ZCekWrA=; b=d5SJnp5L55UkGo1Z+IupQH6lgu 0gkbpMt2/QZ4OvDi8xybTKth8gEqRWU3azU0NGb1gQMBIoYHblgP9l8SkGX1G9+uUvRgki1kHPZmD 6XVTPqS9TRmXEXTB/cP7I5WpebsIfo0D8yDIjbhDPKbkwDEcrpdXEzyFK5LOOhF4TDAvwAbVriqgq 2nfUW9+XjyizpJOLyVruQBK7PFEZw9ImhShAnMgiQJWk5tPYJ67cio1VNzFHTkPrq4mh2yoNjhjIf m1aQOc+E/U/brKoYAysMB07FpTjrAY185m9Q3ofZoZeouVvl/NHMBmjpwYXYi1QBrv3vTQjT0dhZG FSY7wkRg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzH7i-00DXRv-7v; Thu, 09 Jun 2022 12:18:50 +0000 Date: Thu, 9 Jun 2022 13:18:50 +0100 From: Matthew Wilcox To: Baolin Wang 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 Subject: Re: [mm] 9b12e49e9b: BUG:Bad_page_state_in_process Message-ID: References: <20220608143819.GA31193@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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.