linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhangfei Gao <zhangfei.gao@linaro.org>
To: Minchan Kim <minchan@kernel.org>,
	John Hubbard <jhubbard@nvidia.com>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	shameerali.kolothum.thodi@huawei.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zhangfei Gao <zhangfei.gao@linaro.org>
Subject: [PATCH] mm: fix is_pinnable_page return value
Date: Sat, 11 Jun 2022 21:34:42 +0800	[thread overview]
Message-ID: <20220611133442.15290-1-zhangfei.gao@linaro.org> (raw)

Commit 1c563432588d ("mm: fix is_pinnable_page against a cma page")
Changes from
return !(is_zone_movable_page(page) || is_migrate_cma_page(page)) ||
        is_zero_pfn(page_to_pfn(page));
to
return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page)));

Unfortunately, this changes the return value since the ! area is error.
It should be:
return !(is_zone_movable_page(page)) || is_zero_pfn(page_to_pfn(page));

This causes qemu to be hung with a passthrough device.

Fixes: 1c563432588d ("mm: fix is_pinnable_page against a cma page")
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 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..bbbcdde6c4dc 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));
 }
 #else
 static inline bool is_pinnable_page(struct page *page)
-- 
2.36.1



             reply	other threads:[~2022-06-11 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11 13:34 Zhangfei Gao [this message]
2022-06-11 14:56 ` Matthew Wilcox
2022-06-11 15:49   ` Zhangfei Gao

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=20220611133442.15290-1-zhangfei.gao@linaro.org \
    --to=zhangfei.gao@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=shameerali.kolothum.thodi@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox