From: John Hubbard <jhubbard@nvidia.com>
To: Peter Xu <peterx@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Matthew Wilcox <willy@infradead.org>,
Yang Shi <shy828301@gmail.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Alistair Popple <apopple@nvidia.com>,
David Hildenbrand <david@redhat.com>,
Vlastimil Babka <vbabka@suse.cz>, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH v4 2/4] mm: Rename zap_skip_check_mapping() to should_zap_page()
Date: Wed, 16 Feb 2022 19:18:03 -0800 [thread overview]
Message-ID: <abd63588-d45b-9d1e-5d1e-b095c8112793@nvidia.com> (raw)
In-Reply-To: <20220216094810.60572-3-peterx@redhat.com>
On 2/16/22 1:48 AM, Peter Xu wrote:
> The previous name is against the natural way people think. Invert the meaning
Definitely.
> and also the return value. No functional change intended.
>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Suggested-by: Hugh Dickins <hughd@google.com>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> mm/memory.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
thanks,
--
John Hubbard
NVIDIA
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 4bfeaca7cbc7..14d8428ff4db 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1326,20 +1326,19 @@ static inline bool should_zap_cows(struct zap_details *details)
>
> /*
> * We set details->zap_mapping when we want to unmap shared but keep private
> - * pages. Return true if skip zapping this page, false otherwise.
> + * pages. Return true if we should zap this page, false otherwise.
> */
> -static inline bool
> -zap_skip_check_mapping(struct zap_details *details, struct page *page)
> +static inline bool should_zap_page(struct zap_details *details, struct page *page)
> {
> /* If we can make a decision without *page.. */
> if (should_zap_cows(details))
> - return false;
> + return true;
>
> /* E.g. zero page */
> if (!page)
> - return false;
> + return true;
>
> - return details->zap_mapping != page_rmapping(page);
> + return details->zap_mapping == page_rmapping(page);
> }
>
> static unsigned long zap_pte_range(struct mmu_gather *tlb,
> @@ -1374,7 +1373,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
> struct page *page;
>
> page = vm_normal_page(vma, addr, ptent);
> - if (unlikely(zap_skip_check_mapping(details, page)))
> + if (unlikely(!should_zap_page(details, page)))
> continue;
> ptent = ptep_get_and_clear_full(mm, addr, pte,
> tlb->fullmm);
> @@ -1408,7 +1407,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
> is_device_exclusive_entry(entry)) {
> struct page *page = pfn_swap_entry_to_page(entry);
>
> - if (unlikely(zap_skip_check_mapping(details, page)))
> + if (unlikely(!should_zap_page(details, page)))
> continue;
> pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
> rss[mm_counter(page)]--;
> @@ -1433,7 +1432,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
> struct page *page;
>
> page = pfn_swap_entry_to_page(entry);
> - if (zap_skip_check_mapping(details, page))
> + if (!should_zap_page(details, page))
> continue;
> rss[mm_counter(page)]--;
> } else if (is_hwpoison_entry(entry)) {
next prev parent reply other threads:[~2022-02-17 3:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 9:48 [PATCH v4 0/4] mm: Rework zap ptes on swap entries Peter Xu
2022-02-16 9:48 ` [PATCH v4 1/4] mm: Don't skip swap entry even if zap_details specified Peter Xu
2022-02-17 2:54 ` Andrew Morton
2022-02-17 4:22 ` Peter Xu
2022-02-17 3:15 ` John Hubbard
2022-02-17 4:46 ` Peter Xu
2022-02-17 5:45 ` John Hubbard
2022-02-16 9:48 ` [PATCH v4 2/4] mm: Rename zap_skip_check_mapping() to should_zap_page() Peter Xu
2022-02-17 3:18 ` John Hubbard [this message]
2022-02-16 9:48 ` [PATCH v4 3/4] mm: Change zap_details.zap_mapping into even_cows Peter Xu
2022-02-17 3:19 ` John Hubbard
2022-02-16 9:48 ` [PATCH v4 4/4] mm: Rework swap handling of zap_pte_range Peter Xu
2022-02-17 3:25 ` John Hubbard
2022-02-17 4:54 ` Peter Xu
2022-02-17 5:46 ` John Hubbard
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=abd63588-d45b-9d1e-5d1e-b095c8112793@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=peterx@redhat.com \
--cc=shy828301@gmail.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.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).