All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Cui <cui.tao@linux.dev>
To: Song Hu <husong@kylinos.cn>, linux-mm@kvack.org
Cc: cui.tao@linux.dev, muchun.song@linux.dev, osalvador@suse.de,
	david@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org,
	roman.gushchin@linux.dev, shakeel.butt@linux.dev, tj@kernel.org,
	mkoutny@suse.com, shuah@kernel.org, cgroups@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] selftests/cgroup: fix missing TAP output in test_hugetlb_memcg
Date: Tue, 14 Jul 2026 11:00:19 +0800	[thread overview]
Message-ID: <e60ca749-ddeb-46f1-baf8-01db8a2df1b9@linux.dev> (raw)
In-Reply-To: <20260714021511.1063700-1-husong@kylinos.cn>



在 2026/7/14 10:15, Song Hu 写道:
> main() in test_hugetlb_memcg never calls ksft_print_header(),
> ksft_set_plan(), or ksft_finished(), so its output has no TAP plan and is
> not valid TAP, unlike the sibling test_memcontrol and test_kmem tests.
> Add the header/plan/finished calls following the same pattern.
> 
> Signed-off-by: Song Hu <husong@kylinos.cn>
> ---
>  tools/testing/selftests/cgroup/test_hugetlb_memcg.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/cgroup/test_hugetlb_memcg.c b/tools/testing/selftests/cgroup/test_hugetlb_memcg.c
> index b627d84358b1..8c5aced813b6 100644
> --- a/tools/testing/selftests/cgroup/test_hugetlb_memcg.c
> +++ b/tools/testing/selftests/cgroup/test_hugetlb_memcg.c
> @@ -199,7 +199,10 @@ static int test_hugetlb_memcg(char *root)
>  int main(int argc, char **argv)
>  {
>  	char root[PATH_MAX];
> -	int ret = EXIT_SUCCESS, has_memory_hugetlb_acc;
> +	int has_memory_hugetlb_acc;
> +
> +	ksft_print_header();
> +	ksft_set_plan(1);
>  
>  	has_memory_hugetlb_acc = proc_mount_contains("memory_hugetlb_accounting");
>  	if (has_memory_hugetlb_acc < 0)
> @@ -211,7 +214,7 @@ int main(int argc, char **argv)
>  	if (get_hugepage_size() != 2048) {
>  		ksft_print_msg("test_hugetlb_memcg requires 2MB hugepages\n");
>  		ksft_test_result_skip("test_hugetlb_memcg\n");
> -		return ret;
> +		ksft_finished();
>  	}
>  
>  	if (cg_find_unified_root(root, sizeof(root), NULL))
> @@ -233,10 +236,9 @@ int main(int argc, char **argv)
>  		ksft_test_result_skip("test_hugetlb_memcg\n");
>  		break;
>  	default:
> -		ret = EXIT_FAILURE;
>  		ksft_test_result_fail("test_hugetlb_memcg\n");
>  		break;
>  	}
>  
> -	return ret;
> +	ksft_finished();
>  }

This one looks good to me — it mirrors the test_memcontrol/test_kmem
pattern and the exit-code semantics are preserved.

Reviewed-by: Tao Cui <cuitao@kylinos.cn>


      reply	other threads:[~2026-07-14  3:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  2:15 [PATCH 1/2] selftests/cgroup: fix missing TAP output in test_hugetlb_memcg Song Hu
2026-07-14  3:00 ` Tao Cui [this message]

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=e60ca749-ddeb-46f1-baf8-01db8a2df1b9@linux.dev \
    --to=cui.tao@linux.dev \
    --cc=cgroups@vger.kernel.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=husong@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=shuah@kernel.org \
    --cc=tj@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.