From: SeongJae Park <sj@kernel.org>
To: akpm@linux-foundation.org, willy@infradead.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
SeongJae Park <sj@kernel.org>
Subject: [PATCH for mm-unstable 1/3] mm/vmscan: Use folio_test_transhuge() for THP check
Date: Wed, 4 May 2022 20:07:56 +0000 [thread overview]
Message-ID: <20220504200758.314478-2-sj@kernel.org> (raw)
In-Reply-To: <20220504200758.314478-1-sj@kernel.org>
Commit 22bf1b68e572 ("vmscan: remove remaining uses of page in
shrink_page_list") on 'mm-unstable' replaces 'PageTransHuge()' with
'folio_test_large()' instead of 'folio_test_transhuge()'. This results
in below build error when 'CONFIG_TRANSPARENT_HUGEPAGE' is unset.
CC mm/vmscan.o
In file included from <command-line>:
In function ‘can_split_folio’,
inlined from ‘shrink_page_list’ at .../linux/mm/vmscan.c:1719:11:
.../linux/include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_178’ declared with attribute error: BUILD_BUG failed
352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
.../linux/include/linux/compiler_types.h:333:4: note: in definition of macro ‘__compiletime_assert’
333 | prefix ## suffix(); \
| ^~~~~~
.../linux/include/linux/compiler_types.h:352:2: note: in expansion of macro ‘_compiletime_assert’
352 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
.../linux/include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
.../linux/include/linux/build_bug.h:59:21: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
| ^~~~~~~~~~~~~~~~
.../linux/include/linux/huge_mm.h:351:2: note: in expansion of macro ‘BUILD_BUG’
351 | BUILD_BUG();
| ^~~~~~~~~
This commit fixes the issue by replacing the check to use
'folio_test_transhuge()'.
Fixes: 22bf1b68e572 ("vmscan: remove remaining uses of page in shrink_page_list")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 40cda196d802..5a0f081a7be5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1714,7 +1714,7 @@ static unsigned int shrink_page_list(struct list_head *page_list,
goto keep_locked;
if (folio_maybe_dma_pinned(folio))
goto keep_locked;
- if (folio_test_large(folio)) {
+ if (folio_test_transhuge(folio)) {
/* cannot split folio, skip it */
if (!can_split_folio(folio, NULL))
goto activate_locked;
--
2.25.1
next prev parent reply other threads:[~2022-05-04 20:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-04 20:07 [PATCH for mm-unstable 0/3] Fix build errors due to folio_test_large() misuse SeongJae Park
2022-05-04 20:07 ` SeongJae Park [this message]
2022-05-04 20:07 ` [PATCH for mm-unstable 2/3] mm/shmem: Use folio_test_transhuge() for THP check SeongJae Park
2022-05-04 20:07 ` [PATCH for mm-unstable 3/3] " SeongJae Park
2022-05-04 20:10 ` [PATCH for mm-unstable 0/3] Fix build errors due to folio_test_large() misuse Matthew Wilcox
2022-05-04 20:23 ` SeongJae Park
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=20220504200758.314478-2-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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).