[PATCH] kselftest: mm: use helper to identify anon_ops in khugepaged test

Yeoreum Yun posted 1 patch 1 day, 1 hour ago
tools/testing/selftests/mm/khugepaged.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] kselftest: mm: use helper to identify anon_ops in khugepaged test
Posted by Yeoreum Yun 1 day, 1 hour ago
Instead of comparing mem_ops->name to determine whether mem_ops is
anon_ops, use the is_anon() helper.

Suggested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
---
NOTE:
  This patch is based on mm/mm-unstable.
---
 tools/testing/selftests/mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c
index bdc0c7c117d9..b0cb02bf1a73 100644
--- a/tools/testing/selftests/mm/khugepaged.c
+++ b/tools/testing/selftests/mm/khugepaged.c
@@ -618,7 +618,7 @@ static bool wait_for_scan(const char *msg, char *p, size_t len,
 		usleep(TICK);
 	}
 
-	if (!strncmp(ops->name, "anon", 4))
+	if (is_anon(ops))
 		madvise(p, len, MADV_NOHUGEPAGE);
 
 	return timeout == -1;
-- 
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
Re: [PATCH] kselftest: mm: use helper to identify anon_ops in khugepaged test
Posted by David Hildenbrand (Arm) 22 hours ago
On 9/23/26 13:01, Yeoreum Yun wrote:
> Instead of comparing mem_ops->name to determine whether mem_ops is
> anon_ops, use the is_anon() helper.
> 
> Suggested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> ---
> NOTE:
>   This patch is based on mm/mm-unstable.
> ---
>  tools/testing/selftests/mm/khugepaged.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c
> index bdc0c7c117d9..b0cb02bf1a73 100644
> --- a/tools/testing/selftests/mm/khugepaged.c
> +++ b/tools/testing/selftests/mm/khugepaged.c
> @@ -618,7 +618,7 @@ static bool wait_for_scan(const char *msg, char *p, size_t len,
>  		usleep(TICK);
>  	}
>  
> -	if (!strncmp(ops->name, "anon", 4))
> +	if (is_anon(ops))
>  		madvise(p, len, MADV_NOHUGEPAGE);
>  
>  	return timeout == -1;

This should be squashed in the other patch under review.

-- 
Cheers,

David
Re: [PATCH] kselftest: mm: use helper to identify anon_ops in khugepaged test
Posted by Yeoreum Yun 20 hours ago
On Wed, Sep 23, 2026 at 03:54:48PM +0200, David Hildenbrand (Arm) wrote:
> On 9/23/26 13:01, Yeoreum Yun wrote:
> > Instead of comparing mem_ops->name to determine whether mem_ops is
> > anon_ops, use the is_anon() helper.
> > 
> > Suggested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> > Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> > ---
> > NOTE:
> >   This patch is based on mm/mm-unstable.
> > ---
> >  tools/testing/selftests/mm/khugepaged.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/mm/khugepaged.c b/tools/testing/selftests/mm/khugepaged.c
> > index bdc0c7c117d9..b0cb02bf1a73 100644
> > --- a/tools/testing/selftests/mm/khugepaged.c
> > +++ b/tools/testing/selftests/mm/khugepaged.c
> > @@ -618,7 +618,7 @@ static bool wait_for_scan(const char *msg, char *p, size_t len,
> >  		usleep(TICK);
> >  	}
> >  
> > -	if (!strncmp(ops->name, "anon", 4))
> > +	if (is_anon(ops))
> >  		madvise(p, len, MADV_NOHUGEPAGE);
> >  
> >  	return timeout == -1;
> 
> This should be squashed in the other patch under review.

Okay. I'll squash with v3.

-- 
Sincerely,
Yeoreum Yun