linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: kernel test robot <oliver.sang@intel.com>,
	0day robot <lkp@intel.com>, LKML <linux-kernel@vger.kernel.org>,
	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
Date: Thu, 9 Jun 2022 13:18:50 +0100	[thread overview]
Message-ID: <YqHlKj5LbmtYGWUy@casper.infradead.org> (raw)
In-Reply-To: <d64da0da-9f71-3ae9-4d72-00b0c42fce5e@linux.alibaba.com>

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.


  reply	other threads:[~2022-06-09 12:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-04  1:32 [RFC PATCH 0/3] Add PUD and kernel PTE level pagetable account Baolin Wang
2022-06-04  1:32 ` [RFC PATCH 1/3] mm: Factor out the pagetable pages account into new helper function Baolin Wang
2022-06-04  1:32 ` [RFC PATCH 2/3] mm: Add PUD level pagetable account Baolin Wang
2022-06-04  1:32 ` [RFC PATCH 3/3] mm: Add kernel PTE level pagetable pages account Baolin Wang
2022-06-08 14:38   ` [mm] 9b12e49e9b: BUG:Bad_page_state_in_process kernel test robot
2022-06-08 15:07     ` Matthew Wilcox
2022-06-09  4:45       ` Baolin Wang
2022-06-09  4:42     ` Baolin Wang
2022-06-09 12:18       ` Matthew Wilcox [this message]
2022-06-10  3:58         ` Baolin Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YqHlKj5LbmtYGWUy@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=lkp@lists.01.org \
    --cc=oliver.sang@intel.com \
    --cc=openrisc@lists.librecores.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox