2021-08-06 09:54:05

by SeongJae Park

[permalink] [raw]
Subject: [PATCH 1/2] mm/PAGE_IDLE_FLAG: Set PAGE_EXTENSION for none-64BIT

From: SeongJae Park <[email protected]>

Commit 128fd80c4c07 ("mm/idle_page_tracking: Make PG_idle reusable") of
linux-mm[1] allows PAGE_IDLE_FLAG to be set without PAGE_EXTENSION
while 64BIT is not set. This makes 'enum page_ext_flags' undefined, so
build fails as below for the config (!64BIT, !PAGE_EXTENSION, and
IDLE_PAGE_FLAG).

$ make ARCH=i386 allnoconfig
$ echo 'CONFIG_PAGE_IDLE_FLAG=y' >> .config
$ make olddefconfig
$ make ARCH=i386
[...]
../include/linux/page_idle.h: In function ‘folio_test_young’:
../include/linux/page_idle.h:25:18: error: ‘PAGE_EXT_YOUNG’ undeclared (first use in this function); did you mean ‘PAGEOUTRUN’?
return test_bit(PAGE_EXT_YOUNG, &page_ext->flags);
[...]

This commit fixes this issue by making PAGE_EXTENSION to be set when
64BIT is not set and PAGE_IDLE_FLAG is set.

[1] https://github.com/hnaz/linux-mm/commit/128fd80c4c07

Fixes: 128fd80c4c07 ("mm/idle_page_tracking: Make PG_idle reusable")
Reported-by: Randy Dunlap <[email protected]>
Signed-off-by: SeongJae Park <[email protected]>
---
mm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/Kconfig b/mm/Kconfig
index d0b85dc12429..50ca602edeb6 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -741,6 +741,7 @@ config DEFERRED_STRUCT_PAGE_INIT

config PAGE_IDLE_FLAG
bool "Add PG_idle and PG_young flags"
+ select PAGE_EXTENSION if !64BIT
help
This feature adds PG_idle and PG_young flags in 'struct page'. PTE
Accessed bit writers can set the state of the bit in the flags to let
@@ -749,7 +750,6 @@ config PAGE_IDLE_FLAG
config IDLE_PAGE_TRACKING
bool "Enable idle page tracking"
depends on SYSFS && MMU && BROKEN
- select PAGE_EXTENSION if !64BIT
select PAGE_IDLE_FLAG
help
This feature allows to estimate the amount of user pages that have
--
2.17.1


2021-08-06 15:06:53

by SeongJae Park

[permalink] [raw]
Subject: [PATCH 2/2] mm/damon/Kconfig: Remove unnecessary PAGE_EXTENSION setup

From: SeongJae Park <[email protected]>

Commit 13d49dbd0123 ("mm/damon: implement primitives for the virtual
memory address spaces") of linux-mm[1] makes DAMON_VADDR to set
PAGE_IDLE_FLAG. PAGE_IDLE_FLAG sets PAGE_EXTENSION if !64BIT. However,
DAMON_VADDR do the same work again. This commit removes the unnecessary
duplicate.

[1] https://github.com/hnaz/linux-mm/commit/13d49dbd0123

Fixes: 13d49dbd0123 ("mm/damon: implement primitives for the virtual memory address spaces")
Reported-by: Randy Dunlap <[email protected]>
Signed-off-by: SeongJae Park <[email protected]>
---
mm/damon/Kconfig | 1 -
1 file changed, 1 deletion(-)

diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig
index 455995152697..37024798a97c 100644
--- a/mm/damon/Kconfig
+++ b/mm/damon/Kconfig
@@ -27,7 +27,6 @@ config DAMON_KUNIT_TEST
config DAMON_VADDR
bool "Data access monitoring primitives for virtual address spaces"
depends on DAMON && MMU
- select PAGE_EXTENSION if !64BIT
select PAGE_IDLE_FLAG
help
This builds the default data access monitoring primitives for DAMON
--
2.17.1

2021-08-07 02:04:42

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 1/2] mm/PAGE_IDLE_FLAG: Set PAGE_EXTENSION for none-64BIT

On 8/6/21 2:51 AM, SeongJae Park wrote:
> From: SeongJae Park <[email protected]>
>
> Commit 128fd80c4c07 ("mm/idle_page_tracking: Make PG_idle reusable") of
> linux-mm[1] allows PAGE_IDLE_FLAG to be set without PAGE_EXTENSION
> while 64BIT is not set. This makes 'enum page_ext_flags' undefined, so
> build fails as below for the config (!64BIT, !PAGE_EXTENSION, and
> IDLE_PAGE_FLAG).
>
> $ make ARCH=i386 allnoconfig
> $ echo 'CONFIG_PAGE_IDLE_FLAG=y' >> .config
> $ make olddefconfig
> $ make ARCH=i386
> [...]
> ../include/linux/page_idle.h: In function ‘folio_test_young’:
> ../include/linux/page_idle.h:25:18: error: ‘PAGE_EXT_YOUNG’ undeclared (first use in this function); did you mean ‘PAGEOUTRUN’?
> return test_bit(PAGE_EXT_YOUNG, &page_ext->flags);
> [...]
>
> This commit fixes this issue by making PAGE_EXTENSION to be set when
> 64BIT is not set and PAGE_IDLE_FLAG is set.
>
> [1] https://github.com/hnaz/linux-mm/commit/128fd80c4c07
>
> Fixes: 128fd80c4c07 ("mm/idle_page_tracking: Make PG_idle reusable")
> Reported-by: Randy Dunlap <[email protected]>
> Signed-off-by: SeongJae Park <[email protected]>

Acked-by: Randy Dunlap <[email protected]> # build-tested

Thanks.

> ---
> mm/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index d0b85dc12429..50ca602edeb6 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -741,6 +741,7 @@ config DEFERRED_STRUCT_PAGE_INIT
>
> config PAGE_IDLE_FLAG
> bool "Add PG_idle and PG_young flags"
> + select PAGE_EXTENSION if !64BIT
> help
> This feature adds PG_idle and PG_young flags in 'struct page'. PTE
> Accessed bit writers can set the state of the bit in the flags to let
> @@ -749,7 +750,6 @@ config PAGE_IDLE_FLAG
> config IDLE_PAGE_TRACKING
> bool "Enable idle page tracking"
> depends on SYSFS && MMU && BROKEN
> - select PAGE_EXTENSION if !64BIT
> select PAGE_IDLE_FLAG
> help
> This feature allows to estimate the amount of user pages that have
>


--
~Randy

2021-08-07 02:06:24

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 2/2] mm/damon/Kconfig: Remove unnecessary PAGE_EXTENSION setup

On 8/6/21 2:51 AM, SeongJae Park wrote:
> From: SeongJae Park <[email protected]>
>
> Commit 13d49dbd0123 ("mm/damon: implement primitives for the virtual
> memory address spaces") of linux-mm[1] makes DAMON_VADDR to set
> PAGE_IDLE_FLAG. PAGE_IDLE_FLAG sets PAGE_EXTENSION if !64BIT. However,
> DAMON_VADDR do the same work again. This commit removes the unnecessary
> duplicate.
>
> [1] https://github.com/hnaz/linux-mm/commit/13d49dbd0123
>
> Fixes: 13d49dbd0123 ("mm/damon: implement primitives for the virtual memory address spaces")
> Reported-by: Randy Dunlap <[email protected]>
> Signed-off-by: SeongJae Park <[email protected]>

Acked-by: Randy Dunlap <[email protected]> # build-tested

Thanks.

> ---
> mm/damon/Kconfig | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig
> index 455995152697..37024798a97c 100644
> --- a/mm/damon/Kconfig
> +++ b/mm/damon/Kconfig
> @@ -27,7 +27,6 @@ config DAMON_KUNIT_TEST
> config DAMON_VADDR
> bool "Data access monitoring primitives for virtual address spaces"
> depends on DAMON && MMU
> - select PAGE_EXTENSION if !64BIT
> select PAGE_IDLE_FLAG
> help
> This builds the default data access monitoring primitives for DAMON
>


--
~Randy