Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3073406pxk; Mon, 7 Sep 2020 02:20:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza9y6UgGHgpBEmR76hEnYlvK+SeyCbaPK+mkSwZ8CI+Agtf6Ff7aXwWjcNdMAzbbAosZk4 X-Received: by 2002:a05:6402:1016:: with SMTP id c22mr21322658edu.89.1599470400302; Mon, 07 Sep 2020 02:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599470400; cv=none; d=google.com; s=arc-20160816; b=Q1UTJSUTa9kA2qq3zhdMAH5A99c3iInqMKlllGj7ldQIHkfeYjLy8JuPO67ezEGbVn v/fI8oFvlLLsPip6jDrktFTlVDs5yyxTR8ZVsYqu5H2fxtqCYwPpVxQf/J3u/uUXcL4w SKjczEo8whcJbLu/c0oWXRgY7LkdO/Mc6uuFQgSUBji8FaRVi701xvT6Oi+DVQSZQJJt PUDDwU0IplTXmvPI8yEqCX3V95oAx/Q1eO9VPv6YIH5bINFVhWEEySYN8vYvnk6Rr32x 7QBt7ySDnZ3JZXVqGxziV3eI6AYllskxWEGyAcl2Ie2EAAGjayS4gllY6J9uith0wS3H EI0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=ADT7o5M3bEZXcg90HbLQK/4i/Wcm7i6jco+tD9TtBk8=; b=wgqKl6E1XkSienDSwu0mZCB7hbcI79rwa5ZXVpjRyyhOeyNXvSWoqKuA9++jotVHNN sSB43W883YYsY5HGZps4Q+EVeaEDz4dTdqz45S7oQoYrNOrOwEf9IQeGF6LXQKhCfkWS +IZhhLFICn+yi9PYMKccHuTcAG8mKge8teH5KVJHyu99ciTa4FXHFOf+FNvqoWVeI2ga delx8KKQMeo7OhLd1JfTFE7NKrTJ6S+Nv5JUPKQ6igP5WpPg0spnI+EQzi+lRbdZo0py pkPDadbjQwRw3SiZ3EcTLdt/13Ji10mGpjuvUikI+JOYFd2WX975o+1BVanu/2OG8API sFGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by2si9912726edb.324.2020.09.07.02.19.37; Mon, 07 Sep 2020 02:20:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728313AbgIGJRp (ORCPT + 99 others); Mon, 7 Sep 2020 05:17:45 -0400 Received: from foss.arm.com ([217.140.110.172]:58392 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728303AbgIGJR2 (ORCPT ); Mon, 7 Sep 2020 05:17:28 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 412D611D4; Mon, 7 Sep 2020 02:17:28 -0700 (PDT) Received: from dell3630.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D95AF3F66E; Mon, 7 Sep 2020 02:17:26 -0700 (PDT) From: Dietmar Eggemann To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Vincent Guittot , Steven Rostedt , Qais Yousef , Phil Auld , Vincent Donnefort Subject: [PATCH 3/3] sched/autogroup: Change autogroup_path() into a static inline function Date: Mon, 7 Sep 2020 11:17:17 +0200 Message-Id: <20200907091717.26116-4-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200907091717.26116-1-dietmar.eggemann@arm.com> References: <20200907091717.26116-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cfs_rq_tg_path() uses, besides cgroup_path(), autogroup_path() to format the path of a taskgroup or autogroup respectively. Provide autogroup_path() as a static inline function like cgroup_path() so cfs_rq_tg_path() (from a tp-2-te converter) can use both in a kernel module build. Signed-off-by: Dietmar Eggemann --- kernel/sched/autogroup.c | 8 -------- kernel/sched/autogroup.h | 8 +++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/kernel/sched/autogroup.c b/kernel/sched/autogroup.c index 2067080bb235..3c6c78d909dd 100644 --- a/kernel/sched/autogroup.c +++ b/kernel/sched/autogroup.c @@ -258,11 +258,3 @@ void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m) autogroup_kref_put(ag); } #endif /* CONFIG_PROC_FS */ - -int autogroup_path(struct task_group *tg, char *buf, int buflen) -{ - if (!task_group_is_autogroup(tg)) - return 0; - - return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); -} diff --git a/kernel/sched/autogroup.h b/kernel/sched/autogroup.h index b96419974a1f..001f4826d781 100644 --- a/kernel/sched/autogroup.h +++ b/kernel/sched/autogroup.h @@ -35,7 +35,13 @@ autogroup_task_group(struct task_struct *p, struct task_group *tg) return tg; } -extern int autogroup_path(struct task_group *tg, char *buf, int buflen); +static inline int autogroup_path(struct task_group *tg, char *buf, int buflen) +{ + if (!task_group_is_autogroup(tg)) + return 0; + + return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id); +} #else /* !CONFIG_SCHED_AUTOGROUP */ -- 2.17.1