All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Popple <apopple@nvidia.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Ralph Campbell <rcampbell@nvidia.com>,
	Christoph Hellwig <hch@lst.de>, Yang Shi <shy828301@gmail.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Shakeel Butt <shakeelb@google.com>,
	<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH 4/4] mm/rmap: try_to_migrate() skip zone_device !device_private
Date: Thu, 8 Jul 2021 09:25:27 +1000	[thread overview]
Message-ID: <10361513.bhMGeGFVFl@nvdebian> (raw)
In-Reply-To: <1241d356-8ec9-f47b-a5ec-9b2bf66d242@google.com>

I know a bit about device private pages but not so much other variants.
try_to_migrate_one() will work with private pages so in general that check
still looks good.

Reviewed-by: Alistair Popple <apopple@nvidia.com>

On Thursday, 8 July 2021 6:13:33 AM AEST Hugh Dickins wrote:
> I know nothing about zone_device pages and !device_private pages; but
> if try_to_migrate_one() will do nothing for them, then it's better that
> try_to_migrate() filter them first, than trawl through all their vmas.
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
>  mm/rmap.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 1235368f0628..795f9d5f8386 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1703,9 +1703,6 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma,
>  	struct mmu_notifier_range range;
>  	enum ttu_flags flags = (enum ttu_flags)(long)arg;
>  
> -	if (is_zone_device_page(page) && !is_device_private_page(page))
> -		return true;
> -
>  	/*
>  	 * When racing against e.g. zap_pte_range() on another cpu,
>  	 * in between its ptep_get_and_clear_full() and page_remove_rmap(),
> @@ -1944,6 +1941,9 @@ void try_to_migrate(struct page *page, enum ttu_flags flags)
>  					TTU_SYNC)))
>  		return;
>  
> +	if (is_zone_device_page(page) && !is_device_private_page(page))
> +		return;
> +
>  	/*
>  	 * During exec, a temporary VMA is setup and later moved.
>  	 * The VMA is moved under the anon_vma lock but not the
> 






  parent reply	other threads:[~2021-07-07 23:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 20:06 [PATCH 1/4] mm/rmap: fix comments left over from recent changes Hugh Dickins
2021-07-07 20:08 ` [PATCH 2/4] mm/rmap: fix old bug: munlocking THP missed other mlocks Hugh Dickins
2021-07-07 20:53   ` Shakeel Butt
2021-07-08 13:58   ` Kirill A. Shutemov
2021-07-09  2:50     ` Hugh Dickins
2021-07-09 10:56       ` Kirill A. Shutemov
2021-07-07 20:11 ` [PATCH 3/4] mm/rmap: fix new bug: premature return from page_mlock_one() Hugh Dickins
2021-07-07 20:22   ` Shakeel Butt
2021-07-07 23:14   ` Alistair Popple
2021-07-07 20:13 ` [PATCH 4/4] mm/rmap: try_to_migrate() skip zone_device !device_private Hugh Dickins
2021-07-07 20:54   ` Shakeel Butt
2021-07-07 23:25   ` Alistair Popple [this message]
2021-07-07 20:22 ` [PATCH 1/4] mm/rmap: fix comments left over from recent changes Shakeel Butt
2021-07-07 21:26 ` Yang Shi
2021-07-07 21:29   ` Yang Shi
2021-07-07 23:34 ` Alistair Popple

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=10361513.bhMGeGFVFl@nvdebian \
    --to=apopple@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=hughd@google.com \
    --cc=jgg@nvidia.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rcampbell@nvidia.com \
    --cc=shakeelb@google.com \
    --cc=shy828301@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.