From: Mike Kravetz <mike.kravetz@oracle.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org
Subject: Re: [PATCH 3/5] mm/hugetlb.c: Remove the unnecessary non_swap_entry()
Date: Mon, 20 Jul 2020 15:44:49 -0700 [thread overview]
Message-ID: <c31b8d1f-0cf3-612c-2722-cfdb474da770@oracle.com> (raw)
In-Reply-To: <20200720062623.13135-4-bhe@redhat.com>
On 7/19/20 11:26 PM, Baoquan He wrote:
> The checking is_migration_entry() and is_hwpoison_entry() are stricter
> than non_swap_entry(), means they have covered the conditional check
> which non_swap_entry() is doing.
>
> Hence remove the unnecessary non_swap_entry() in is_hugetlb_entry_migration()
> and is_hugetlb_entry_hwpoisoned() to simplify code.
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
Agreed, we can remove the checks for non_swap_entry.
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
--
Mike Kravetz
> ---
> mm/hugetlb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index a58f976a9dd9..467894d8332a 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3748,7 +3748,7 @@ bool is_hugetlb_entry_migration(pte_t pte)
> if (huge_pte_none(pte) || pte_present(pte))
> return false;
> swp = pte_to_swp_entry(pte);
> - if (non_swap_entry(swp) && is_migration_entry(swp))
> + if (is_migration_entry(swp))
> return true;
> else
> return false;
> @@ -3761,7 +3761,7 @@ static bool is_hugetlb_entry_hwpoisoned(pte_t pte)
> if (huge_pte_none(pte) || pte_present(pte))
> return false;
> swp = pte_to_swp_entry(pte);
> - if (non_swap_entry(swp) && is_hwpoison_entry(swp))
> + if (is_hwpoison_entry(swp))
> return true;
> else
> return false;
>
next prev parent reply other threads:[~2020-07-20 22:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 6:26 [PATCH 0/5] mm/hugetlb: Small cleanup and improvement Baoquan He
2020-07-20 6:26 ` [PATCH 1/5] mm/hugetlb.c: Fix typo of glb_reserve Baoquan He
2020-07-20 22:32 ` Mike Kravetz
2020-07-21 9:17 ` Baoquan He
2020-07-20 6:26 ` [PATCH 2/5] mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool Baoquan He
2020-07-20 22:34 ` Mike Kravetz
2020-07-21 9:56 ` David Hildenbrand
2020-07-20 6:26 ` [PATCH 3/5] mm/hugetlb.c: Remove the unnecessary non_swap_entry() Baoquan He
2020-07-20 22:44 ` Mike Kravetz [this message]
2020-07-21 9:56 ` David Hildenbrand
2020-07-20 6:26 ` [PATCH 4/5] doc/vm: fix typo in in the hugetlb admin documentation Baoquan He
2020-07-20 22:55 ` Mike Kravetz
2020-07-21 9:56 ` David Hildenbrand
2020-07-20 6:26 ` [PATCH 5/5] mm/hugetl.c: warn out if expected count of huge pages adjustment is not achieved Baoquan He
2020-07-21 0:38 ` Mike Kravetz
2020-07-21 9:55 ` Baoquan He
2020-07-22 8:49 ` Baoquan He
2020-07-22 16:15 ` Mike Kravetz
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=c31b8d1f-0cf3-612c-2722-cfdb474da770@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).