mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Cc: Zefan Li <lizefan.x@bytedance.com>, Tejun Heo <tj@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH v3 2/3] selftests: cgroup: Minor code reorganizations
Date: Mon, 3 Jul 2023 14:01:26 -0400	[thread overview]
Message-ID: <4bae7852-61b9-999d-765d-a8f0d0084256@redhat.com> (raw)
In-Reply-To: <20230703172741.25392-3-mkoutny@suse.com>


On 7/3/23 13:27, Michal Koutný wrote:
> No functional change intended, these small changes are merged into one
> commit and they serve as a preparation for an upcoming new testcase.
>
> Signed-off-by: Michal Koutný <mkoutny@suse.com>
> ---
>   MAINTAINERS                                       | 1 +
>   tools/testing/selftests/cgroup/cgroup_util.c      | 2 ++
>   tools/testing/selftests/cgroup/cgroup_util.h      | 2 ++
>   tools/testing/selftests/cgroup/test_core.c        | 2 +-
>   tools/testing/selftests/cgroup/test_cpuset_prs.sh | 2 +-
>   5 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e0976ae2a523..03bec83944c4 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5260,6 +5260,7 @@ T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git
>   F:	Documentation/admin-guide/cgroup-v1/cpusets.rst
>   F:	include/linux/cpuset.h
>   F:	kernel/cgroup/cpuset.c
> +F:	tools/testing/selftests/cgroup/test_cpuset_prs.sh
>   
>   CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)
>   M:	Johannes Weiner <hannes@cmpxchg.org>
> diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
> index e8bbbdb77e0d..0340d4ca8f51 100644
> --- a/tools/testing/selftests/cgroup/cgroup_util.c
> +++ b/tools/testing/selftests/cgroup/cgroup_util.c
> @@ -286,6 +286,8 @@ int cg_destroy(const char *cgroup)
>   {
>   	int ret;
>   
> +	if (!cgroup)
> +		return 0;
>   retry:
>   	ret = rmdir(cgroup);
>   	if (ret && errno == EBUSY) {
> diff --git a/tools/testing/selftests/cgroup/cgroup_util.h b/tools/testing/selftests/cgroup/cgroup_util.h
> index c92df4e5d395..1df7f202214a 100644
> --- a/tools/testing/selftests/cgroup/cgroup_util.h
> +++ b/tools/testing/selftests/cgroup/cgroup_util.h
> @@ -11,6 +11,8 @@
>   #define USEC_PER_SEC	1000000L
>   #define NSEC_PER_SEC	1000000000L
>   
> +#define TEST_UID	65534 /* usually nobody, any !root is fine */
> +
>   /*
>    * Checks if two given values differ by less than err% of their sum.
>    */
> diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c
> index 600123503063..80aa6b2373b9 100644
> --- a/tools/testing/selftests/cgroup/test_core.c
> +++ b/tools/testing/selftests/cgroup/test_core.c
> @@ -683,7 +683,7 @@ static int test_cgcore_thread_migration(const char *root)
>    */
>   static int test_cgcore_lesser_euid_open(const char *root)
>   {
> -	const uid_t test_euid = 65534;	/* usually nobody, any !root is fine */
> +	const uid_t test_euid = TEST_UID;
>   	int ret = KSFT_FAIL;
>   	char *cg_test_a = NULL, *cg_test_b = NULL;
>   	char *cg_test_a_procs = NULL, *cg_test_b_procs = NULL;
> diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> index 2b5215cc599f..4afb132e4e4f 100755
> --- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> +++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
> @@ -10,7 +10,7 @@
>   skip_test() {
>   	echo "$1"
>   	echo "Test SKIPPED"
> -	exit 0
> +	exit 4 # ksft_skip
>   }
>   
>   [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!"
Reviewed-by: Waiman Long <longman@redhat.com>


  reply	other threads:[~2023-07-03 18:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 17:27 [PATCH v3 0/3] cpuset: Allow setscheduler regardless of manipulated task Michal Koutný
2023-07-03 17:27 ` [PATCH v3 1/3] " Michal Koutný
2023-07-03 18:00   ` Waiman Long
2023-07-03 17:27 ` [PATCH v3 2/3] selftests: cgroup: Minor code reorganizations Michal Koutný
2023-07-03 18:01   ` Waiman Long [this message]
2023-07-03 17:27 ` [PATCH v3 3/3] selftests: cgroup: Add cpuset migrations testcase Michal Koutný
2023-07-10 20:30 ` [PATCH v3 0/3] cpuset: Allow setscheduler regardless of manipulated task Tejun Heo

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=4bae7852-61b9-999d-765d-a8f0d0084256@redhat.com \
    --to=longman@redhat.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mkoutny@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®