From: Peter Xu <peterx@redhat.com>
To: Hongchen Zhang <zhanghongchen@loongson.cn>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alistair Popple <apopple@nvidia.com>,
Ralph Campbell <rcampbell@nvidia.com>,
Naoya Horiguchi <naoya.horiguchi@nec.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/swapops: make is_pmd_migration_entry more strict
Date: Thu, 28 Apr 2022 14:41:14 -0400 [thread overview]
Message-ID: <YmrfynZf7bU0Uoys@xz-m1.local> (raw)
In-Reply-To: <1651131333-6386-1-git-send-email-zhanghongchen@loongson.cn>
On Thu, Apr 28, 2022 at 03:35:33PM +0800, Hongchen Zhang wrote:
> a pmd migration entry should first be a swap pmd,so
> use is_swap_pmd(pmd) instead of !pmd_present(pmd).
>
> On the other hand, some architecture (MIPS for example)
> may misjudge a pmd_none entry as a pmd migration entry.
>
> Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
The change looks reasonable,
Acked-by: Peter Xu <peterx@redhat.com>
Two more pure questions..
(1) is there a real issue to be fixed with it? Asked because I see most
calls to is_pmd_migration_entry() should already make sure it's not
none, and,
(2) why it matters with MIPS? Firstly this function is not used in arch
specific code, and iiuc thp migration is not enabled at all for mips.
Thanks,
> ---
> include/linux/swapops.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/swapops.h b/include/linux/swapops.h
> index d356ab4..1d16569 100644
> --- a/include/linux/swapops.h
> +++ b/include/linux/swapops.h
> @@ -304,7 +304,7 @@ static inline pmd_t swp_entry_to_pmd(swp_entry_t entry)
>
> static inline int is_pmd_migration_entry(pmd_t pmd)
> {
> - return !pmd_present(pmd) && is_migration_entry(pmd_to_swp_entry(pmd));
> + return is_swap_pmd(pmd) && is_migration_entry(pmd_to_swp_entry(pmd));
> }
> #else
> static inline void set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw,
> --
> 1.8.3.1
>
--
Peter Xu
next prev parent reply other threads:[~2022-04-28 18:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 7:35 Hongchen Zhang
2022-04-28 18:41 ` Peter Xu [this message]
2022-04-29 2:23 ` Hongchen Zhang
2022-04-29 13:31 ` Peter Xu
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=YmrfynZf7bU0Uoys@xz-m1.local \
--to=peterx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=naoya.horiguchi@nec.com \
--cc=rcampbell@nvidia.com \
--cc=zhanghongchen@loongson.cn \
/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
all inboxes | Powered by JetHome®