From patchwork Wed Jan 23 15:26:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 156382 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp841408jaa; Wed, 23 Jan 2019 07:27:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN5UCsqF6Gab4F1C/kTVzv/I/RZZzujQggIdbBn27E/xtWUQSmig2vhIFin1vq9T7GXUHfqp X-Received: by 2002:a17:902:aa4c:: with SMTP id c12mr2629146plr.48.1548257230622; Wed, 23 Jan 2019 07:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548257230; cv=none; d=google.com; s=arc-20160816; b=P3daxxZuxH8h1eFLjlPMz0fO/UdtNNeR3AMqSgt53fZToAinb18bzakv3X8AmRTbAI F2OQqOwTZGFe+2xCrP622+n9kOipbg40SwqiEB71AdlXLzqHZ3X+c2lWW5ustwvxhd/h nhneLkxKEvwRpN1jd4LUQZ2IYDdxmrkxedAE9rKfplI1/K5sBrM1H1Rsw5vWNakq6215 sIt3zwBwmLd1a3eS7M4St8gHhx7f4m31dD1N49QXO4F1Z90Wfe3e/gfLQAyurp0rER3/ 8A4iTg9T+NcK3D/SfF8Ki/aiE4IHDxrk6p4uUN8S+xW18cP2gsQ0iwc6htf6aHgCYzDA djyQ== 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:dkim-signature; bh=hReVLUTWGkU8mA22pHwBBkB0pAs98jcygffTpDVc1AM=; b=QoJFIfFFSI5YjB9N+9JwtRqSm5XJhfNNUjrHCBEP43Y7mU16DhHuQ1Z1PY31+y+b1t d+mEZSQvZpZ0CqNBgFdw5K695Pdi7vs8uofIu5D5PpgZuF+Xg8AL/iXm1UD9Yw2SUmjf qr968Mfs3X/zYAI0xSuzgKSSvNYkXF/33jv33jPN/7gRlopONKK/SRk+MInadWqPrvV8 70qnEUE0rVggArdRMqR2o2oST+F63IMIZml6f5c+0FsELlidiNKsz/H9MgiH2+ewUtz9 hdgsLmfXo8qje06uD52EdobLpcWMkvjDmWQlwf/1ZiI+sKNOT00UBVU45y0IKI9HCm6C X15w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H5xZtLXo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si18827418plz.118.2019.01.23.07.27.10; Wed, 23 Jan 2019 07:27:10 -0800 (PST) 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=@linaro.org header.s=google header.b=H5xZtLXo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbfAWP1I (ORCPT + 31 others); Wed, 23 Jan 2019 10:27:08 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:56260 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbfAWP1F (ORCPT ); Wed, 23 Jan 2019 10:27:05 -0500 Received: by mail-wm1-f66.google.com with SMTP id y139so2364114wmc.5 for ; Wed, 23 Jan 2019 07:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hReVLUTWGkU8mA22pHwBBkB0pAs98jcygffTpDVc1AM=; b=H5xZtLXokiLacrs6wDPekNuZfdOP9oqcYTVEw8J0HQAGoGxxyrgpFxpldRIbRdApTj cIKDzK2pmHR4AQtkSNmSDC2SHei2MUZBMt97zvXp9goIwxMofKBwRrvsYJdv2bNOWAXW RHtWGK+EFbzelUcb/mu78bsLyRNodM3lUHlRc= 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; bh=hReVLUTWGkU8mA22pHwBBkB0pAs98jcygffTpDVc1AM=; b=SgOqq+cXzcgEcWdtINcXwDl8yyR6pWdGIPbQU5fb9Kb6BzSYjL0u6fsLm4jDoipc5/ tikX1u+ZB3AugVKeaf7iLx0TF5g/N4asaFX/7lDxyKZF563EcH48jiuUettaaX8VWZh4 2QrSFSPcz0PXxUJxz01vqjky610ST9Fr+vyNU0rk5Dy587r2fVvUUsrPaBHyqeus3XvU XUnu2WAhjZGek6k0CweQrYfT8CPdly0h7RizL/qVQnfAu/OrOrUzAN4IzhIy0wG3LYcd 5moGW6/5fy3OmasPkVNN++w41Hw+kct3N341UbWsbaXgAHThZqxUB+jpCls7ZLfjOb1L FvVg== X-Gm-Message-State: AJcUukd3zBvWxPDmOY6MvI74PONkHBBRlFHYti0TIzrSi6KYFtRGrNZj A0myrtsyWjpVEYgeKnn0uS+9Uw== X-Received: by 2002:a1c:7d06:: with SMTP id y6mr3086261wmc.7.1548257223075; Wed, 23 Jan 2019 07:27:03 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:5ca6:2921:648b:56b6]) by smtp.gmail.com with ESMTPSA id b13sm92938536wrn.28.2019.01.23.07.27.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Jan 2019 07:27:01 -0800 (PST) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org Cc: rjw@rjwysocki.net, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, patrick.bellasi@arm.com, pjt@google.com, bsegall@google.com, thara.gopinath@linaro.org, pkondeti@codeaurora.org, quentin.perret@arm.com, srinivas.pandruvada@linux.intel.com, Vincent Guittot Subject: [PATCH v9 1/3] sched/fair: move rq_of helper function Date: Wed, 23 Jan 2019 16:26:52 +0100 Message-Id: <1548257214-13745-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548257214-13745-1-git-send-email-vincent.guittot@linaro.org> References: <1548257214-13745-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move rq_of() helper function so it can be used in pelt.c Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 13 ------------- kernel/sched/sched.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e2ff4b6..cdddc86 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -248,13 +248,6 @@ const struct sched_class fair_sched_class; */ #ifdef CONFIG_FAIR_GROUP_SCHED - -/* cpu runqueue to which this cfs_rq is attached */ -static inline struct rq *rq_of(struct cfs_rq *cfs_rq) -{ - return cfs_rq->rq; -} - static inline struct task_struct *task_of(struct sched_entity *se) { SCHED_WARN_ON(!entity_is_task(se)); @@ -410,12 +403,6 @@ static inline struct task_struct *task_of(struct sched_entity *se) return container_of(se, struct task_struct, se); } -static inline struct rq *rq_of(struct cfs_rq *cfs_rq) -{ - return container_of(cfs_rq, struct rq, cfs); -} - - #define for_each_sched_entity(se) \ for (; se; se = NULL) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index d27c1a5..d57a590 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -951,6 +951,22 @@ struct rq { #endif }; +#ifdef CONFIG_FAIR_GROUP_SCHED + +/* cpu runqueue to which this cfs_rq is attached */ +static inline struct rq *rq_of(struct cfs_rq *cfs_rq) +{ + return cfs_rq->rq; +} + +#else /* !CONFIG_FAIR_GROUP_SCHED */ + +static inline struct rq *rq_of(struct cfs_rq *cfs_rq) +{ + return container_of(cfs_rq, struct rq, cfs); +} +#endif + static inline int cpu_of(struct rq *rq) { #ifdef CONFIG_SMP