Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2248148ybd; Mon, 24 Jun 2019 03:16:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAvvv2ZI5Rs05cx+j0kMEK2kFfhVbWfvYbehLfYbEg1WX0ReqfoFpJsEYZXf0cLrlH3ZLl X-Received: by 2002:a17:902:100a:: with SMTP id b10mr6740261pla.338.1561371361657; Mon, 24 Jun 2019 03:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371361; cv=none; d=google.com; s=arc-20160816; b=rD6kPFW+Bah5dZHRjD+yFTqd1GgTHMjYI0KPiBGAGKkmZDjlpcu+WgaJQm53b8ZJx+ FAN0tCeUgMR/BzruGxecMHN0pKaLo9aTfxBQO1vx0HWlZZsILtoxP35NQKKlLEwrLXrV UzUBA/96CJRG5xrqoadfwvhC3MafCTm46PWCM6+4IlgWdt7Pgoo/HqOST6Grt+L9HoKw rTsfCAmnqrdjSWBDl+aPTpFJOWpG+c7l0GlZ+B+TaWOJvgtlG7eBzM+CiZPTc6A4Mme/ IeYe199NXPx4qjZs4Q7CQ/7TIvZI9Dj1lElY2s1qN0ECdg3lQ0ot0l9D/nn8RlMACThE pfaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XTB/OrcDc09cuZJ8FtglYqsI1t1X5k6ueyOx0t5p8gc=; b=ArXsvcro2IlfJf30Rr6FN2Mt0k7mbLTPt/mmI8zgpIsm8UT3UsK4TcLDl5QeFN3qYH MhOlax8pFlLYQ+W6CIog13tucrJRXqXnKgOKZ6nL9GbYeo5pGM0zBFqzYxGqFvrOkNSE jhP15kELntbBVhKb2zVoERybvhRRTNJPYvK2DSFKqpMgZ7zVNpedZH5DBFz0MLR8AIfS 2M9bDsymkLIIaCpClkQzvRLrz7B80yxsO4K68PhgGY8D8A5ycHq2pW4IULy77NjT+aST LlbJhhiwbbMHNsiA84z3xkqWjjtiMxvo7xAip/WgbGfw9l4238Da3cRxzKb3DDEUNwLx Dwtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sz5FWTi/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si9169874pfk.90.2019.06.24.03.15.45; Mon, 24 Jun 2019 03:16:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sz5FWTi/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729766AbfFXKPj (ORCPT + 99 others); Mon, 24 Jun 2019 06:15:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729706AbfFXKPh (ORCPT ); Mon, 24 Jun 2019 06:15:37 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED80F205C9; Mon, 24 Jun 2019 10:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371336; bh=STDA67ny//z8ON3EELw205CswwM8s+oAnWBfK72PmZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sz5FWTi//gGeX5nudyUDhjg+6Uoo/I+wulrHXrlh6eB8bxDlgIrGFZUrPMJDMa5Nk eET+YJRhPt3V8rE3hJzuSE2EUt+QaVHuiPhCb4l6QiPeh2E5QnQuc1OnSD2UeB355Y 8NTnD4nGdWj5ghFQtJkUUbpjA03Yvu5NyhZ5NS3Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Shi , Shuah Khan , Tejun Heo , Roman Gushchin , Claudio Zumbo , Claudio , linux-kselftest@vger.kernel.org, Shuah Khan , Sasha Levin Subject: [PATCH 5.1 058/121] kselftest/cgroup: fix unexpected testing failure on test_core Date: Mon, 24 Jun 2019 17:56:30 +0800 Message-Id: <20190624092323.670943186@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 00e38a5d753d7788852f81703db804a60a84c26e ] The cgroup testing relys on the root cgroup's subtree_control setting, If the 'memory' controller isn't set, some test cases will be failed as following: $sudo ./test_core not ok 1 test_cgcore_internal_process_constraint ok 2 test_cgcore_top_down_constraint_enable not ok 3 test_cgcore_top_down_constraint_disable ... To correct this unexpected failure, this patch write the 'memory' to subtree_control of root to get a right result. Signed-off-by: Alex Shi Cc: Shuah Khan Cc: Tejun Heo Cc: Roman Gushchin Cc: Claudio Zumbo Cc: Claudio Cc: linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Roman Gushchin Acked-by: Tejun Heo Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/cgroup/test_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/cgroup/test_core.c b/tools/testing/selftests/cgroup/test_core.c index be59f9c34ea2..d78f1c5366d3 100644 --- a/tools/testing/selftests/cgroup/test_core.c +++ b/tools/testing/selftests/cgroup/test_core.c @@ -376,6 +376,11 @@ int main(int argc, char *argv[]) if (cg_find_unified_root(root, sizeof(root))) ksft_exit_skip("cgroup v2 isn't mounted\n"); + + if (cg_read_strstr(root, "cgroup.subtree_control", "memory")) + if (cg_write(root, "cgroup.subtree_control", "+memory")) + ksft_exit_skip("Failed to set memory controller\n"); + for (i = 0; i < ARRAY_SIZE(tests); i++) { switch (tests[i].fn(root)) { case KSFT_PASS: -- 2.20.1