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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 B857DC43457 for ; Tue, 20 Oct 2020 01:44:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 785D422260 for ; Tue, 20 Oct 2020 01:44:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="LlG484iM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390338AbgJTBoy (ORCPT ); Mon, 19 Oct 2020 21:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390327AbgJTBov (ORCPT ); Mon, 19 Oct 2020 21:44:51 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A92C0613CE for ; Mon, 19 Oct 2020 18:44:51 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id l16so269384ilt.13 for ; Mon, 19 Oct 2020 18:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SYRuExtbSgWjM4FYX9nCK6I1/Pc07M5b5kD77e19zKs=; b=LlG484iMib0jL0GPGukjEQ3DL6YTJU0PjdixF56M1scF3k2e4TqSo8q2vUDde9AzJJ n5UFQdlYgHpxTJEi/Ndkg+6o/YOm0BFGp5p29Bz1HWAfbPKbtZo7hbxltapZ631elOVp 3bc5M9ce38R7z3mW3fcDNW8mZxkdwxFM7+dOs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SYRuExtbSgWjM4FYX9nCK6I1/Pc07M5b5kD77e19zKs=; b=VFWSxzS3OgYMInZkjaF3aQY1aq4FcN9s4JWQx38/klrrsW56kD+hgfS4TQ/lKeMCT7 xP89UVH1ANqYuZnqdOMTGM7mnP+fQaVVmlqitxXxVUjkbd6qDqbYRByM4rao6b3WmLmT MOOf6V40J4HlmcnAznqwkoW9z5kSYutATaKKcRFyYc+8tFkR1SaBDk6Oc6NkzSlbzcR9 RplN+GGmNUq/tceVqU1e0tnP+DodM3bF7Pz5TS6JT6uIoUpGRMFy709cQJxey02G0OG7 RjQxoM//WmmdumGRG8aizfmcXH6blPI7ktqLTJNMcgOpRyFL9NWCOdOLVJ78loKb70BI Z10g== X-Gm-Message-State: AOAM531K8eWHavNyNnIkpOYYbATSaWYZDVL8SdrtAk2eSZXef2jSC65R n/txVl13UjZ1aYpFA3OXNXfpQw== X-Google-Smtp-Source: ABdhPJwPa9seXOoLAWqrvdnPYhYYR1KaMUU/hhDyuFi/TXq+8CHYhwFpotLHJGi6fqVJOYhym7BH8g== X-Received: by 2002:a92:bb57:: with SMTP id w84mr241736ili.41.1603158291116; Mon, 19 Oct 2020 18:44:51 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id t22sm485306ili.9.2020.10.19.18.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 18:44:50 -0700 (PDT) From: "Joel Fernandes (Google)" To: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org Cc: mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , joel@joelfernandes.org, vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, pjt@google.com, rostedt@goodmis.org, derkling@google.com, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , jsbarnes@google.com, chris.hyser@oracle.com, Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: [PATCH v8 -tip 22/26] sched/debug: Add CGroup node for printing group cookie if SCHED_DEBUG Date: Mon, 19 Oct 2020 21:43:32 -0400 Message-Id: <20201020014336.2076526-23-joel@joelfernandes.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201020014336.2076526-1-joel@joelfernandes.org> References: <20201020014336.2076526-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will be used by kselftest to verify the CGroup cookie value that is set by the CGroup interface. Tested-by: Julien Desfossez Signed-off-by: Joel Fernandes (Google) --- kernel/sched/core.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 1321c26a8385..b3afbba5abe1 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -9520,6 +9520,13 @@ static u64 cpu_core_tag_color_read_u64(struct cgroup_subsys_state *css, struct c return tg->core_tag_color; } +#ifdef CONFIG_SCHED_DEBUG +static u64 cpu_core_group_cookie_read_u64(struct cgroup_subsys_state *css, struct cftype *cft) +{ + return cpu_core_get_group_cookie(css_tg(css)); +} +#endif + struct write_core_tag { struct cgroup_subsys_state *css; unsigned long cookie; @@ -9695,6 +9702,14 @@ static struct cftype cpu_legacy_files[] = { .read_u64 = cpu_core_tag_color_read_u64, .write_u64 = cpu_core_tag_color_write_u64, }, +#ifdef CONFIG_SCHED_DEBUG + /* Read the effective cookie (color+tag) of the group. */ + { + .name = "core_group_cookie", + .flags = CFTYPE_NOT_ON_ROOT, + .read_u64 = cpu_core_group_cookie_read_u64, + }, +#endif #endif #ifdef CONFIG_UCLAMP_TASK_GROUP { @@ -9882,6 +9897,14 @@ static struct cftype cpu_files[] = { .read_u64 = cpu_core_tag_color_read_u64, .write_u64 = cpu_core_tag_color_write_u64, }, +#ifdef CONFIG_SCHED_DEBUG + /* Read the effective cookie (color+tag) of the group. */ + { + .name = "core_group_cookie", + .flags = CFTYPE_NOT_ON_ROOT, + .read_u64 = cpu_core_group_cookie_read_u64, + }, +#endif #endif #ifdef CONFIG_CFS_BANDWIDTH { -- 2.29.0.rc1.297.gfa9743e501-goog