From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D51BC48BE9 for ; Mon, 24 Jun 2019 10:04:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5491E205ED for ; Mon, 24 Jun 2019 10:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561370697; bh=STDA67ny//z8ON3EELw205CswwM8s+oAnWBfK72PmZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KJ/w5HOmXJm866cCEfsMRiDphVto3Nf8RPxK1v3SIwyI3fhRpw3oZWgFtpbgxHuBT PwjooacXftEQiUad/EkrtU1RCKpyQZ1GNXFI4W8aTi352ohkPVpqOgXINFuyjheACA 3pR1HzaQVZQZXwxzO7o3yqq8XrnRpBAW4h4Ui4II= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729418AbfFXKEt (ORCPT ); Mon, 24 Jun 2019 06:04:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729778AbfFXKEp (ORCPT ); Mon, 24 Jun 2019 06:04:45 -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 285E2208E3; Mon, 24 Jun 2019 10:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561370684; bh=STDA67ny//z8ON3EELw205CswwM8s+oAnWBfK72PmZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TSTfacn+bt7femopyuuxJ7YqYDTx+0cH9r5b+NF4RvBBcVPwX5NoBhYsA3zaC0d2R muB3YPT1gw4tXD/TTVD+Zw1+GdnWUJ1oUnKYgQ62XWxamqL2qI+n9HLdsYV+nS+Q1S XrvB7cOO6OJATffdVjHlu9moiDPONEwWftgfTYNk= 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 4.19 46/90] kselftest/cgroup: fix unexpected testing failure on test_core Date: Mon, 24 Jun 2019 17:56:36 +0800 Message-Id: <20190624092317.273524505@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092313.788773607@linuxfoundation.org> References: <20190624092313.788773607@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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