From: Minchan Kim <minchan@kernel.org>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, paulmck@kernel.org,
jhubbard@nvidia.com, joaodias@google.com, jgg@ziepe.ca,
david@redhat.com
Subject: Re: [PATCH] mm: Re-allow pinning of zero pfns
Date: Fri, 10 Jun 2022 17:21:52 -0700 [thread overview]
Message-ID: <YqPgIJ2+OaltxRmV@google.com> (raw)
In-Reply-To: <165490039431.944052.12458624139225785964.stgit@omen>
On Fri, Jun 10, 2022 at 04:35:13PM -0600, Alex Williamson wrote:
> The commit referenced below subtly and inadvertently changed the logic
> to disallow pinning of zero pfns. This breaks device assignment with
> vfio and potentially various other users of gup. Exclude the zero page
> test from the negation.
>
> Fixes: 1c563432588d ("mm: fix is_pinnable_page against a cma page")
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>
> At least I assume this was inadvertent... If there's a better fix,
> please run with it as I'm out of the office the 1st half of next
> week and would like to see this fixed ASAP. Thanks!
>
> include/linux/mm.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index bc8f326be0ce..781fae17177d 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page)
> if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE)
> return false;
> #endif
> - return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page)));
> + return !is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page));
Thanks for catching!
I don't think zero pfn could stay in the movable zone or CMA area.
Acked-by: Minchan Kim <minchan@kernel.org>
next prev parent reply other threads:[~2022-06-11 0:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 22:35 [PATCH] mm: Re-allow pinning of zero pfns Alex Williamson
2022-06-11 0:21 ` Minchan Kim [this message]
2022-06-11 18:29 ` David Hildenbrand
2022-06-15 15:56 ` Jason Gunthorpe
2022-06-23 18:07 ` David Hildenbrand
2022-06-23 20:21 ` Alex Williamson
2022-06-23 20:47 ` Jason Gunthorpe
2022-06-24 0:11 ` Alistair Popple
2022-06-24 1:34 ` Jason Gunthorpe
2022-06-24 1:55 ` Alistair Popple
2022-07-28 8:45 ` Alistair Popple
2022-07-28 9:23 ` David Hildenbrand
2022-07-29 2:49 ` 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=YqPgIJ2+OaltxRmV@google.com \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=david@redhat.com \
--cc=jgg@ziepe.ca \
--cc=jhubbard@nvidia.com \
--cc=joaodias@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=paulmck@kernel.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 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.