Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26549035rwd; Mon, 3 Jul 2023 11:11:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGaAZzEIV+xeYxfwO9Xw3NREQuLBs5tEIpgFUS2hVyMK1Z2Sl1FgBAr9vUQKUujKZDlzjN0 X-Received: by 2002:a05:6a00:1ad1:b0:666:e42c:d5fb with SMTP id f17-20020a056a001ad100b00666e42cd5fbmr15235158pfv.32.1688407897365; Mon, 03 Jul 2023 11:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688407897; cv=none; d=google.com; s=arc-20160816; b=UtGveGlpLWELkY2iAl6wLsTbPvw3PEgVLVCOSCy6TOM+JH787dFLp7AWQsv7aMUL9O xJ6zpRezg7Vqy73UMmeod0fd4ozy3zagorc/+2q+gm6p0ynPr0VPdQnanmwfPQq1SaYV E++wkU3fz/1kC5VRcUYStsIOrFWmOzQcqZaHY+xkGrbJ3NmbpUgBPWsMFwrIJqhR3BW2 7m3AFj4mdO+j3TXSuiPd13Qy/sAtpnqBTodDQ74Wl6GEyTQ6qDfMq/X5L6kYq7w9LLSK PV58/aX0yWr7o+bCGIJynXAX6pTp6OQtxroPrJ6MocJPtXnxSdx2wxxU+7sfo6D5uJuz 7W0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=iFe8atToFS2utTEa2xH/lGx0LLo+DpKgRn21BdsYeHk=; fh=ysiSFr8VSGWfC2KarFMapg/5VZs/S1TuD1fbkbi2nDU=; b=JxIHZzbNL5tolrC9/UuCebUX4C2K2EQA5hJsbetXQBgxVhK4V/xZPB4mburvAmYoZD vpavQ7aIVjijOaH/6LIc2kvaIuVK3BtZrXFP/My4QJIkb2jL8awmemhC/dIyfXAoIFuJ emrtzg7pe075oyxgEF5KBvxFC8nCAxPX35OoeadJB9WK8ulHFa6CCIIochwvrzy+jZtZ 6D/UbfrWiJFmu5AilsaZxVLvwPfgY2zQn0SMA+MHTRPY53BRbtUWKomd5cCkjG0TpwdA Vx0FdRXAcr6Hnp2ib7ufRwGSLEKxiibgZIrrhZKekDFmAEN+JdbwIt1NXOCh350g8x3w ZIzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Wd1pxJvG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az9-20020a056a02004900b0055339136a7dsi137801pgb.883.2023.07.03.11.11.23; Mon, 03 Jul 2023 11:11:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Wd1pxJvG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbjGCSCV (ORCPT + 99 others); Mon, 3 Jul 2023 14:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjGCSCU (ORCPT ); Mon, 3 Jul 2023 14:02:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80D55E5F for ; Mon, 3 Jul 2023 11:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688407290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iFe8atToFS2utTEa2xH/lGx0LLo+DpKgRn21BdsYeHk=; b=Wd1pxJvGXxlmMf9t0xa1JiMxrotbteGKXMymMWiA3CGwGcNpOvX+g7uIJ1gnW9WSePywZa excj2dA+pKAV8Dvu4uJ8LhNLJtGktXPXM1JEgbldXPUTgdAKHBbTDv99YcTQwZVicXKGJ9 D8JWIE2peuAZch/m+IDIEHdKCSSiHCI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-492-qlbEta4WP7Otec50GMPY9g-1; Mon, 03 Jul 2023 14:01:27 -0400 X-MC-Unique: qlbEta4WP7Otec50GMPY9g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 139C93C02B68; Mon, 3 Jul 2023 18:01:27 +0000 (UTC) Received: from [10.22.17.92] (unknown [10.22.17.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACF6D2166B31; Mon, 3 Jul 2023 18:01:26 +0000 (UTC) Message-ID: <4bae7852-61b9-999d-765d-a8f0d0084256@redhat.com> Date: Mon, 3 Jul 2023 14:01:26 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 2/3] selftests: cgroup: Minor code reorganizations Content-Language: en-US To: =?UTF-8?Q?Michal_Koutn=c3=bd?= , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Zefan Li , Tejun Heo , Johannes Weiner , Shuah Khan References: <20230703172741.25392-1-mkoutny@suse.com> <20230703172741.25392-3-mkoutny@suse.com> From: Waiman Long In-Reply-To: <20230703172741.25392-3-mkoutny@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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ý > --- > 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 > 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