linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages
@ 2025-01-16 14:44 Usama Arif
  2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
  2025-01-16 18:49 ` [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages SeongJae Park
  0 siblings, 2 replies; 10+ messages in thread
From: Usama Arif @ 2025-01-16 14:44 UTC (permalink / raw)
  To: sj, akpm; +Cc: damon, linux-mm, Usama Arif

This effectively adds support for large folios in damon for paddr,
as damon_pa_mkold/young won't get a null folio from this function
and won't ignore it, hence access will be checked and reported.
This also means that larger folios will be considered for
different DAMOS actions like pageout, prioritization and migration.
As these DAMOS actions will consider larger folios, iterate through
the region at folio_size and not PAGE_SIZE intervals.
This should not have an affect on vaddr, as damon_young_pmd_entry
considers pmd entries.

Signed-off-by: Usama Arif <usamaarif642@gmail.com>
---
 mm/damon/ops-common.c |  2 +-
 mm/damon/paddr.c      | 24 ++++++++++++++++++------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index d25d99cb5f2b..d511be201c4c 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -24,7 +24,7 @@ struct folio *damon_get_folio(unsigned long pfn)
 	struct page *page = pfn_to_online_page(pfn);
 	struct folio *folio;
 
-	if (!page || PageTail(page))
+	if (!page)
 		return NULL;
 
 	folio = page_folio(page);
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index bd8cfe10121b..c0ccf4fade24 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -266,11 +266,14 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s,
 		damos_add_filter(s, filter);
 	}
 
-	for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) {
+	addr = r->ar.start;
+	while (addr < r->ar.end) {
 		struct folio *folio = damon_get_folio(PHYS_PFN(addr));
 
-		if (!folio)
+		if (!folio) {
+			addr += PAGE_SIZE;
 			continue;
+		}
 
 		if (damos_pa_filter_out(s, folio))
 			goto put_folio;
@@ -286,6 +289,7 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s,
 		else
 			list_add(&folio->lru, &folio_list);
 put_folio:
+		addr += folio_size(folio);
 		folio_put(folio);
 	}
 	if (install_young_filter)
@@ -301,11 +305,14 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
 {
 	unsigned long addr, applied = 0;
 
-	for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) {
+	addr = r->ar.start;
+	while (addr < r->ar.end) {
 		struct folio *folio = damon_get_folio(PHYS_PFN(addr));
 
-		if (!folio)
+		if (!folio) {
+			addr += PAGE_SIZE;
 			continue;
+		}
 
 		if (damos_pa_filter_out(s, folio))
 			goto put_folio;
@@ -318,6 +325,7 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
 			folio_deactivate(folio);
 		applied += folio_nr_pages(folio);
 put_folio:
+		addr += folio_size(folio);
 		folio_put(folio);
 	}
 	return applied * PAGE_SIZE;
@@ -464,11 +472,14 @@ static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s,
 	unsigned long addr, applied;
 	LIST_HEAD(folio_list);
 
-	for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) {
+	addr = r->ar.start;
+	while (addr < r->ar.end) {
 		struct folio *folio = damon_get_folio(PHYS_PFN(addr));
 
-		if (!folio)
+		if (!folio) {
+			addr += PAGE_SIZE;
 			continue;
+		}
 
 		if (damos_pa_filter_out(s, folio))
 			goto put_folio;
@@ -479,6 +490,7 @@ static unsigned long damon_pa_migrate(struct damon_region *r, struct damos *s,
 			goto put_folio;
 		list_add(&folio->lru, &folio_list);
 put_folio:
+		addr += folio_size(folio);
 		folio_put(folio);
 	}
 	applied = damon_pa_migrate_pages(&folio_list, s->target_nid);
-- 
2.43.5



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 14:44 [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages Usama Arif
@ 2025-01-16 14:44 ` Usama Arif
  2025-01-16 15:15   ` Usama Arif
                     ` (3 more replies)
  2025-01-16 18:49 ` [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages SeongJae Park
  1 sibling, 4 replies; 10+ messages in thread
From: Usama Arif @ 2025-01-16 14:44 UTC (permalink / raw)
  To: sj, akpm; +Cc: damon, linux-mm, Usama Arif

This is to gather statistics to check if hotest memory regions
are backed by hugepages. This includes both THPs and hugetlbfs.
This filter can help to observe and prove the effectivenes of
different schemes for shrinking/collapsing hugepages.

Signed-off-by: Usama Arif <usamaarif642@gmail.com>
---
 include/linux/damon.h    | 2 ++
 mm/damon/paddr.c         | 3 +++
 mm/damon/sysfs-schemes.c | 1 +
 3 files changed, 6 insertions(+)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index af525252b853..1d94d7d88b36 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -326,6 +326,7 @@ struct damos_stat {
  * @DAMOS_FILTER_TYPE_ANON:	Anonymous pages.
  * @DAMOS_FILTER_TYPE_MEMCG:	Specific memcg's pages.
  * @DAMOS_FILTER_TYPE_YOUNG:	Recently accessed pages.
+ * @DAMOS_FILTER_TYPE_HUGEPAGE:	Page is part of a hugepage.
  * @DAMOS_FILTER_TYPE_ADDR:	Address range.
  * @DAMOS_FILTER_TYPE_TARGET:	Data Access Monitoring target.
  * @NR_DAMOS_FILTER_TYPES:	Number of filter types.
@@ -345,6 +346,7 @@ enum damos_filter_type {
 	DAMOS_FILTER_TYPE_ANON,
 	DAMOS_FILTER_TYPE_MEMCG,
 	DAMOS_FILTER_TYPE_YOUNG,
+	DAMOS_FILTER_TYPE_HUGEPAGE,
 	DAMOS_FILTER_TYPE_ADDR,
 	DAMOS_FILTER_TYPE_TARGET,
 	NR_DAMOS_FILTER_TYPES,
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index c0ccf4fade24..a9e69179d45c 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -222,6 +222,9 @@ static bool damos_pa_filter_match(struct damos_filter *filter,
 		if (matched)
 			damon_folio_mkold(folio);
 		break;
+	case DAMOS_FILTER_TYPE_HUGEPAGE:
+		matched = folio_size(folio) == HPAGE_PMD_SIZE;
+		break;
 	default:
 		break;
 	}
diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
index 98f93ae9f59e..de9265f7ccde 100644
--- a/mm/damon/sysfs-schemes.c
+++ b/mm/damon/sysfs-schemes.c
@@ -329,6 +329,7 @@ static const char * const damon_sysfs_scheme_filter_type_strs[] = {
 	"anon",
 	"memcg",
 	"young",
+	"hugepage",
 	"addr",
 	"target",
 };
-- 
2.43.5



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
@ 2025-01-16 15:15   ` Usama Arif
  2025-01-16 19:07     ` SeongJae Park
  2025-01-16 19:05   ` SeongJae Park
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Usama Arif @ 2025-01-16 15:15 UTC (permalink / raw)
  To: sj, akpm; +Cc: damon, linux-mm



On 16/01/2025 14:44, Usama Arif wrote:
> This is to gather statistics to check if hotest memory regions
> are backed by hugepages. This includes both THPs and hugetlbfs.
> This filter can help to observe and prove the effectivenes of
> different schemes for shrinking/collapsing hugepages.
> 
> Signed-off-by: Usama Arif <usamaarif642@gmail.com>
> ---
>  include/linux/damon.h    | 2 ++
>  mm/damon/paddr.c         | 3 +++
>  mm/damon/sysfs-schemes.c | 1 +
>  3 files changed, 6 insertions(+)

The corresponding DAMO PR is at https://github.com/damonitor/damo/pull/19




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages
  2025-01-16 14:44 [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages Usama Arif
  2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
@ 2025-01-16 18:49 ` SeongJae Park
  1 sibling, 0 replies; 10+ messages in thread
From: SeongJae Park @ 2025-01-16 18:49 UTC (permalink / raw)
  To: Usama Arif; +Cc: SeongJae Park, akpm, damon, linux-mm

On Thu, 16 Jan 2025 14:44:35 +0000 Usama Arif <usamaarif642@gmail.com> wrote:

> This effectively adds support for large folios in damon for paddr,
> as damon_pa_mkold/young won't get a null folio from this function
> and won't ignore it, hence access will be checked and reported.
> This also means that larger folios will be considered for
> different DAMOS actions like pageout, prioritization and migration.
> As these DAMOS actions will consider larger folios, iterate through
> the region at folio_size and not PAGE_SIZE intervals.
> This should not have an affect on vaddr, as damon_young_pmd_entry
> considers pmd entries.

This patch will improve both accuracy of monitoring results and efficiency of
DAMOS for paddr use cases on THP-enabled systems.  Thank you Usama!

> 
> Signed-off-by: Usama Arif <usamaarif642@gmail.com>

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
  2025-01-16 15:15   ` Usama Arif
@ 2025-01-16 19:05   ` SeongJae Park
  2025-01-17 11:02     ` Usama Arif
  2025-01-18  8:09   ` kernel test robot
  2025-01-18 10:34   ` kernel test robot
  3 siblings, 1 reply; 10+ messages in thread
From: SeongJae Park @ 2025-01-16 19:05 UTC (permalink / raw)
  To: Usama Arif; +Cc: SeongJae Park, akpm, damon, linux-mm

On Thu, 16 Jan 2025 14:44:36 +0000 Usama Arif <usamaarif642@gmail.com> wrote:

> This is to gather statistics to check if hotest memory regions

s/hotest/hottest/?

> are backed by hugepages.

This would also be useful for not only hottest memory regions but general
memory regions of specific access temperature.  I like this.

> This includes both THPs and hugetlbfs.
> This filter can help to observe and prove the effectivenes of
> different schemes for shrinking/collapsing hugepages.

Nice extension of DAMON's page level properties based monitoring!

> 
> Signed-off-by: Usama Arif <usamaarif642@gmail.com>
> ---
>  include/linux/damon.h    | 2 ++
>  mm/damon/paddr.c         | 3 +++
>  mm/damon/sysfs-schemes.c | 1 +
>  3 files changed, 6 insertions(+)
> 
> diff --git a/include/linux/damon.h b/include/linux/damon.h
> index af525252b853..1d94d7d88b36 100644
> --- a/include/linux/damon.h
> +++ b/include/linux/damon.h
> @@ -326,6 +326,7 @@ struct damos_stat {
>   * @DAMOS_FILTER_TYPE_ANON:	Anonymous pages.
>   * @DAMOS_FILTER_TYPE_MEMCG:	Specific memcg's pages.
>   * @DAMOS_FILTER_TYPE_YOUNG:	Recently accessed pages.
> + * @DAMOS_FILTER_TYPE_HUGEPAGE:	Page is part of a hugepage.
>   * @DAMOS_FILTER_TYPE_ADDR:	Address range.
>   * @DAMOS_FILTER_TYPE_TARGET:	Data Access Monitoring target.
>   * @NR_DAMOS_FILTER_TYPES:	Number of filter types.
> @@ -345,6 +346,7 @@ enum damos_filter_type {
>  	DAMOS_FILTER_TYPE_ANON,
>  	DAMOS_FILTER_TYPE_MEMCG,
>  	DAMOS_FILTER_TYPE_YOUNG,
> +	DAMOS_FILTER_TYPE_HUGEPAGE,
>  	DAMOS_FILTER_TYPE_ADDR,
>  	DAMOS_FILTER_TYPE_TARGET,
>  	NR_DAMOS_FILTER_TYPES,
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index c0ccf4fade24..a9e69179d45c 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -222,6 +222,9 @@ static bool damos_pa_filter_match(struct damos_filter *filter,
>  		if (matched)
>  			damon_folio_mkold(folio);
>  		break;
> +	case DAMOS_FILTER_TYPE_HUGEPAGE:
> +		matched = folio_size(folio) == HPAGE_PMD_SIZE;
> +		break;

This will make build fails when CONFIG_PGTABLE_HAS_HUGE_LEAVES is not set, like
below:

 /include/linux/compiler_types.h:542:45: error: call to ‘__compiletime_assert_321’ declared with attribute error: BUILD_BUG failed
   542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
       |                                             ^
[...]
 /include/linux/huge_mm.h:111:35: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
   111 | #define HPAGE_PMD_SIZE  ((1UL) << HPAGE_PMD_SHIFT)
       |                                   ^~~~~~~~~~~~~~~
 /mm/damon/paddr.c:321:48: note: in expansion of macro ‘HPAGE_PMD_SIZE’
   321 |                 matched = folio_size(folio) == HPAGE_PMD_SIZE;
       |                                                ^~~~~~~~~~~~~~


This simple test might help you reproducing it:
https://github.com/damonitor/damon-tests/blob/master/corr/tests/build_i386.sh

What about enclosing the entire case with

    #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE) ?

>  	default:
>  		break;
>  	}
> diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
> index 98f93ae9f59e..de9265f7ccde 100644
> --- a/mm/damon/sysfs-schemes.c
> +++ b/mm/damon/sysfs-schemes.c
> @@ -329,6 +329,7 @@ static const char * const damon_sysfs_scheme_filter_type_strs[] = {
>  	"anon",
>  	"memcg",
>  	"young",
> +	"hugepage",
>  	"addr",
>  	"target",
>  };

Other parts look good to me :)


Thanks,
SJ

[...]


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 15:15   ` Usama Arif
@ 2025-01-16 19:07     ` SeongJae Park
  0 siblings, 0 replies; 10+ messages in thread
From: SeongJae Park @ 2025-01-16 19:07 UTC (permalink / raw)
  To: Usama Arif; +Cc: SeongJae Park, akpm, damon, linux-mm

On Thu, 16 Jan 2025 15:15:21 +0000 Usama Arif <usamaarif642@gmail.com> wrote:

> 
> 
> On 16/01/2025 14:44, Usama Arif wrote:
> > This is to gather statistics to check if hotest memory regions
> > are backed by hugepages. This includes both THPs and hugetlbfs.
> > This filter can help to observe and prove the effectivenes of
> > different schemes for shrinking/collapsing hugepages.
> > 
> > Signed-off-by: Usama Arif <usamaarif642@gmail.com>
> > ---
> >  include/linux/damon.h    | 2 ++
> >  mm/damon/paddr.c         | 3 +++
> >  mm/damon/sysfs-schemes.c | 1 +
> >  3 files changed, 6 insertions(+)
> 
> The corresponding DAMO PR is at https://github.com/damonitor/damo/pull/19

Thank you for taking care of the user-space tool together!  I will do review on
the PR.


Thanks,
SJ


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 19:05   ` SeongJae Park
@ 2025-01-17 11:02     ` Usama Arif
  2025-01-17 17:08       ` SeongJae Park
  0 siblings, 1 reply; 10+ messages in thread
From: Usama Arif @ 2025-01-17 11:02 UTC (permalink / raw)
  To: SeongJae Park; +Cc: akpm, damon, linux-mm



On 16/01/2025 19:05, SeongJae Park wrote:
> On Thu, 16 Jan 2025 14:44:36 +0000 Usama Arif <usamaarif642@gmail.com> wrote:
> 
>> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
>> index c0ccf4fade24..a9e69179d45c 100644
>> --- a/mm/damon/paddr.c
>> +++ b/mm/damon/paddr.c
>> @@ -222,6 +222,9 @@ static bool damos_pa_filter_match(struct damos_filter *filter,
>>  		if (matched)
>>  			damon_folio_mkold(folio);
>>  		break;
>> +	case DAMOS_FILTER_TYPE_HUGEPAGE:
>> +		matched = folio_size(folio) == HPAGE_PMD_SIZE;
>> +		break;
> 
> This will make build fails when CONFIG_PGTABLE_HAS_HUGE_LEAVES is not set, like
> below:
> 
>  /include/linux/compiler_types.h:542:45: error: call to ‘__compiletime_assert_321’ declared with attribute error: BUILD_BUG failed
>    542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>        |                                             ^
> [...]
>  /include/linux/huge_mm.h:111:35: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
>    111 | #define HPAGE_PMD_SIZE  ((1UL) << HPAGE_PMD_SHIFT)
>        |                                   ^~~~~~~~~~~~~~~
>  /mm/damon/paddr.c:321:48: note: in expansion of macro ‘HPAGE_PMD_SIZE’
>    321 |                 matched = folio_size(folio) == HPAGE_PMD_SIZE;
>        |                                                ^~~~~~~~~~~~~~
> 
> 
> This simple test might help you reproducing it:
> https://github.com/damonitor/damon-tests/blob/master/corr/tests/build_i386.sh
> 
> What about enclosing the entire case with
> 
>     #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE) ?
> 

Ah Thanks for pointing this out! Would 

#if defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)

be better?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-17 11:02     ` Usama Arif
@ 2025-01-17 17:08       ` SeongJae Park
  0 siblings, 0 replies; 10+ messages in thread
From: SeongJae Park @ 2025-01-17 17:08 UTC (permalink / raw)
  To: Usama Arif; +Cc: SeongJae Park, akpm, damon, linux-mm

On Fri, 17 Jan 2025 11:02:05 +0000 Usama Arif <usamaarif642@gmail.com> wrote:

> 
> 
> On 16/01/2025 19:05, SeongJae Park wrote:
> > On Thu, 16 Jan 2025 14:44:36 +0000 Usama Arif <usamaarif642@gmail.com> wrote:
> > 
> >> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> >> index c0ccf4fade24..a9e69179d45c 100644
> >> --- a/mm/damon/paddr.c
> >> +++ b/mm/damon/paddr.c
> >> @@ -222,6 +222,9 @@ static bool damos_pa_filter_match(struct damos_filter *filter,
> >>  		if (matched)
> >>  			damon_folio_mkold(folio);
> >>  		break;
> >> +	case DAMOS_FILTER_TYPE_HUGEPAGE:
> >> +		matched = folio_size(folio) == HPAGE_PMD_SIZE;
> >> +		break;
> > 
> > This will make build fails when CONFIG_PGTABLE_HAS_HUGE_LEAVES is not set, like
> > below:
> > 
> >  /include/linux/compiler_types.h:542:45: error: call to ‘__compiletime_assert_321’ declared with attribute error: BUILD_BUG failed
> >    542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
> >        |                                             ^
> > [...]
> >  /include/linux/huge_mm.h:111:35: note: in expansion of macro ‘HPAGE_PMD_SHIFT’
> >    111 | #define HPAGE_PMD_SIZE  ((1UL) << HPAGE_PMD_SHIFT)
> >        |                                   ^~~~~~~~~~~~~~~
> >  /mm/damon/paddr.c:321:48: note: in expansion of macro ‘HPAGE_PMD_SIZE’
> >    321 |                 matched = folio_size(folio) == HPAGE_PMD_SIZE;
> >        |                                                ^~~~~~~~~~~~~~
> > 
> > 
> > This simple test might help you reproducing it:
> > https://github.com/damonitor/damon-tests/blob/master/corr/tests/build_i386.sh
> > 
> > What about enclosing the entire case with
> > 
> >     #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE) ?
> > 
> 
> Ah Thanks for pointing this out! Would 
> 
> #if defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
> 
> be better?

Yes, that also looks good to me :)


Thanks,
SJ


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
  2025-01-16 15:15   ` Usama Arif
  2025-01-16 19:05   ` SeongJae Park
@ 2025-01-18  8:09   ` kernel test robot
  2025-01-18 10:34   ` kernel test robot
  3 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2025-01-18  8:09 UTC (permalink / raw)
  To: Usama Arif, sj, akpm; +Cc: llvm, oe-kbuild-all, damon, linux-mm, Usama Arif

Hi Usama,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Usama-Arif/mm-damon-introduce-DAMOS-filter-type-hugepage/20250116-224546
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250116144436.3947318-2-usamaarif642%40gmail.com
patch subject: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
config: i386-randconfig-014-20250118 (https://download.01.org/0day-ci/archive/20250118/202501181509.wyig2s2H-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250118/202501181509.wyig2s2H-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501181509.wyig2s2H-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/damon/paddr.c:12:
   In file included from include/linux/pagemap.h:8:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   In file included from mm/damon/paddr.c:17:
   include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      47 |         __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
         |                                    ~~~~~~~~~~~ ^ ~~~
   include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      49 |                                 NR_ZONE_LRU_BASE + lru, nr_pages);
         |                                 ~~~~~~~~~~~~~~~~ ^ ~~~
   5 warnings generated.
>> ld.lld: error: call to __compiletime_assert_374 marked "dontcall-error": BUILD_BUG failed

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
  2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
                     ` (2 preceding siblings ...)
  2025-01-18  8:09   ` kernel test robot
@ 2025-01-18 10:34   ` kernel test robot
  3 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2025-01-18 10:34 UTC (permalink / raw)
  To: Usama Arif, sj, akpm; +Cc: llvm, oe-kbuild-all, damon, linux-mm, Usama Arif

Hi Usama,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Usama-Arif/mm-damon-introduce-DAMOS-filter-type-hugepage/20250116-224546
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20250116144436.3947318-2-usamaarif642%40gmail.com
patch subject: [v1 2/2] mm/damon: introduce DAMOS filter type hugepage
config: x86_64-randconfig-077-20250118 (https://download.01.org/0day-ci/archive/20250118/202501181819.RVctFodO-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250118/202501181819.RVctFodO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501181819.RVctFodO-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/damon/paddr.c:17:
   include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      47 |         __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
         |                                    ~~~~~~~~~~~ ^ ~~~
   include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      49 |                                 NR_ZONE_LRU_BASE + lru, nr_pages);
         |                                 ~~~~~~~~~~~~~~~~ ^ ~~~
>> mm/damon/paddr.c:226:34: error: call to '__compiletime_assert_603' declared with 'error' attribute: BUILD_BUG failed
     226 |                 matched = folio_size(folio) == HPAGE_PMD_SIZE;
         |                                                ^
   include/linux/huge_mm.h:111:34: note: expanded from macro 'HPAGE_PMD_SIZE'
     111 | #define HPAGE_PMD_SIZE  ((1UL) << HPAGE_PMD_SHIFT)
         |                                   ^
   include/linux/huge_mm.h:104:28: note: expanded from macro 'HPAGE_PMD_SHIFT'
     104 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
         |                            ^
   include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG'
      59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
         |                     ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:530:2: note: expanded from macro '_compiletime_assert'
     530 |         __compiletime_assert(condition, msg, prefix, suffix)
         |         ^
   include/linux/compiler_types.h:523:4: note: expanded from macro '__compiletime_assert'
     523 |                         prefix ## suffix();                             \
         |                         ^
   <scratch space>:50:1: note: expanded from here
      50 | __compiletime_assert_603
         | ^
   2 warnings and 1 error generated.


vim +226 mm/damon/paddr.c

   200	
   201	static bool damos_pa_filter_match(struct damos_filter *filter,
   202			struct folio *folio)
   203	{
   204		bool matched = false;
   205		struct mem_cgroup *memcg;
   206	
   207		switch (filter->type) {
   208		case DAMOS_FILTER_TYPE_ANON:
   209			matched = folio_test_anon(folio);
   210			break;
   211		case DAMOS_FILTER_TYPE_MEMCG:
   212			rcu_read_lock();
   213			memcg = folio_memcg_check(folio);
   214			if (!memcg)
   215				matched = false;
   216			else
   217				matched = filter->memcg_id == mem_cgroup_id(memcg);
   218			rcu_read_unlock();
   219			break;
   220		case DAMOS_FILTER_TYPE_YOUNG:
   221			matched = damon_folio_young(folio);
   222			if (matched)
   223				damon_folio_mkold(folio);
   224			break;
   225		case DAMOS_FILTER_TYPE_HUGEPAGE:
 > 226			matched = folio_size(folio) == HPAGE_PMD_SIZE;
   227			break;
   228		default:
   229			break;
   230		}
   231	
   232		return matched == filter->matching;
   233	}
   234	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-01-18 10:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 14:44 [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages Usama Arif
2025-01-16 14:44 ` [v1 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
2025-01-16 15:15   ` Usama Arif
2025-01-16 19:07     ` SeongJae Park
2025-01-16 19:05   ` SeongJae Park
2025-01-17 11:02     ` Usama Arif
2025-01-17 17:08       ` SeongJae Park
2025-01-18  8:09   ` kernel test robot
2025-01-18 10:34   ` kernel test robot
2025-01-16 18:49 ` [v1 1/2] mm/damon: have damon_get_folio return folio even for tail pages SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox