Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp775771imu; Tue, 20 Nov 2018 06:50:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/WmMAxXaLTMpgZNTMWg7Rqzdvnl9L/fxlnsz8dtzivomKW1wC6ybDrVa8z+xhMOtfwRChM4 X-Received: by 2002:a63:790e:: with SMTP id u14mr2159580pgc.452.1542725414262; Tue, 20 Nov 2018 06:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542725414; cv=none; d=google.com; s=arc-20160816; b=05G/W6u6j3UVp0t2Sz+m4R+aFp6YHhY39gOe4SvwBrKkGcuJVLuaITAuQ9aWmh8dUY W0QFT/hEB+kqNneonMkEAkVgTaSCqQ2jNV4kBeJmbzAvS8FDfG8rxAXSqB6GRGH5+p8I oRscyz2tfjcZTH6y6B+vxGWuP6TSAyLXqjDRKdK6l94CaVoTPh35ZSM5Age7zp0wxxPX JV4uLqaLrzIy4Tuj7EkCteb9VXpwtClk71VU+0mcu7kSJ0OMM/X/jipI6uYRibD3FJy0 o3/ylugqIqFZlKIVHlLDCflKGa6Zz/oFDKSzRpDoHc5KBYCMoDayF4BLppt9mhPHP4x6 WMnw== 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=/iWf/+HB2fUc3oesF9Db4tB9eQPZYersbB7xwtVyrfc=; b=dmXaE2dRBdmIlWFyzLlc9qadtWtTHjc8edTlzLHZjowMP018jqV/2c+iABMv2sJUie Xegm773X+67RSiKRC/rWHlpcg/GD5H3PyJYATKICninqZDiV+JUYPLarp4nLWltae19a gUE5p5M+e7mEDoVZRa+Br3WL1W8kXm/FYvuj17qqDpINyrpldHXw+hmb2VpBocgFUd9I PS9pcKp2gzpISCMZWJ8Wm44rpeuMMU5tIaLqc6e7C5zn2dMA/rSpbap3uuRQD9cjGnlY swpEGLMyuYs+CX5zHK2Ok7Ze/4uXhPoz8nXQuxLi85XyInWUMtNoESBYkxGKY1NVWHxn slKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hvuOU2yq; 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 n17-v6si492849plp.183.2018.11.20.06.49.59; Tue, 20 Nov 2018 06:50:14 -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=hvuOU2yq; 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 S1728872AbeKTVXx (ORCPT + 99 others); Tue, 20 Nov 2018 16:23:53 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39204 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728785AbeKTVXw (ORCPT ); Tue, 20 Nov 2018 16:23:52 -0500 Received: by mail-wm1-f67.google.com with SMTP id u13-v6so1711241wmc.4 for ; Tue, 20 Nov 2018 02:55:19 -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=/iWf/+HB2fUc3oesF9Db4tB9eQPZYersbB7xwtVyrfc=; b=hvuOU2yqaSaMmmG7R6c+p0kQEl3WQZXePoVlOppAxtxMO5Ma2Tqp7qJh+pzVvnVax8 IND/SKFDgp7bHwf50q4ObPijaOEVkWOtw/apkYVnW8tEZ1Qg5gzzTMWp7MYW/crIiJsW 2Ws62WCecltU7/EwlTbxCZdhvRwkxULSBpTAA= 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=/iWf/+HB2fUc3oesF9Db4tB9eQPZYersbB7xwtVyrfc=; b=F5FCTFzxtY5pfHF0GClz2t+t9lTEkLXoEcuHkpuyBnTTuLJ60w0z1B40w1koeiceg+ KhUW5h+nZdB7RQFbg4nI3J11TvjLpRsEnfboN8oUFynLVbwmnuOmKbe9lnKWKSNFHJdu 4Ov1zda2pQ1AWAe7dD1AwrwdQYwMSluYlw+vMMc992jZrQSjd+wavK/uziK+SajRVpTt FG/R0sIGsBPujpLdOaXmzOo1bvmKvhnBnFR0JyQxvMTKW9pzX6voywnt9AbmD9FHjOG7 h9syKHN5rvLnj2xAcpcBceI/Cm0clHgegHUaTyKktPhF6jYnHoLouZhFk/Pb26d4Op6Z SuLg== X-Gm-Message-State: AA+aEWbLp1MgGzSCGEaIDz4dxEPPY52KKjy22g4u+6gYP7fmpWThC+UU yrgq6NNN8vSYZ/MoWcASYDN2AA== X-Received: by 2002:a1c:c919:: with SMTP id f25mr1793283wmb.75.1542711318889; Tue, 20 Nov 2018 02:55:18 -0800 (PST) Received: from localhost.localdomain ([2a01:e0a:f:6020:c511:7193:974b:48e6]) by smtp.gmail.com with ESMTPSA id f192sm12170831wmd.12.2018.11.20.02.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Nov 2018 02:55:18 -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 v7 1/2] sched/fair: move rq_of helper function Date: Tue, 20 Nov 2018 11:55:07 +0100 Message-Id: <1542711308-25256-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542711308-25256-1-git-send-email-vincent.guittot@linaro.org> References: <1542711308-25256-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(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e30dea5..9cd1f32 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)); @@ -411,12 +404,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 e0e052a..67e2d56 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -930,6 +930,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 -- 2.7.4