From patchwork Fri Oct 26 16:11:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 149599 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp959364ljp; Fri, 26 Oct 2018 09:11:54 -0700 (PDT) X-Google-Smtp-Source: AJdET5dHFxqaRO0MkVAHlY7G3j0pRTT8HsnmysAEdbMQ5/LLfRDMe1OGj35THfDrmOIX0GYed+xs X-Received: by 2002:a62:5d49:: with SMTP id r70-v6mr4391674pfb.123.1540570314581; Fri, 26 Oct 2018 09:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540570314; cv=none; d=google.com; s=arc-20160816; b=ZDBZU2zVg5diAl+se+CQLcYItf1r6KIWYEZvsz42LrR/7g3xFqW00Xxr/DzDunSbrz +Mw8+60PY1OzshANA6U8A2j22zc+rIXhEtaPUI0MMJjn/ySzoZc/65IYoKy0Axziah8E 4RngnN5TmmUZCos7U3mXB/7MpyG03uP9AaWbxOkAEKWG6Di7ykhM0ien1h+Lv8UIlgHf 15L6JCgnNc5yViXWwTOcqvJGWX3njG5JOp6fnLNKgOZG87cNtPkqz6xnk/LuwTXU6xRc sKzj0WSfa8elIQNhGmh/FN9IVvrs6ohbnJsG/8kfQ1x2oeovqROBHZRXfxS9bHkF64Bo +snQ== 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=qwD5lMO+Jv5rC3Vbru4Vtmb8zAHEDsjHqlZgpqUjRR8=; b=E2EcUbb5V8KmFAaPFWSaXisYT/Nl0RxNP6R9Kvr7ClHd/SzF+Bg6QYkOB4limSuseb shkaDuar5s4izMBPcAJbv4nPrRpeLGTqvJIESGBmszhAqpcdKDbuanDszAz+AWD1OK3L nsbEbs4LXm38TkIoAFuUJ3y62UHJZrf/Im4BcLVDYds2P1R0x6PVECHCKoIt9GJtSY/s bZmD331Hdogq3dlEIv8ZJ1GkL9u6vpl2Q+eoiZdriIIFaJAyfIgQDa4coqOOwrGaAO8s hFQj6AJU6VJF0hXI7uLmT/IL0Ff2KLPn3vNTxnjGAVqxj/nzRZ8HZoqaDqyf9rdzwp4L tj7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H25pe06r; 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 e24-v6si11802132pgj.287.2018.10.26.09.11.54; Fri, 26 Oct 2018 09:11:54 -0700 (PDT) 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=H25pe06r; 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 S1727662AbeJ0Ata (ORCPT + 32 others); Fri, 26 Oct 2018 20:49:30 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52509 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbeJ0At2 (ORCPT ); Fri, 26 Oct 2018 20:49:28 -0400 Received: by mail-wm1-f66.google.com with SMTP id 189-v6so2041933wmw.2 for ; Fri, 26 Oct 2018 09:11:49 -0700 (PDT) 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=qwD5lMO+Jv5rC3Vbru4Vtmb8zAHEDsjHqlZgpqUjRR8=; b=H25pe06rx+frN9OjQrKtkbdQTsca3GsL+X2Xl8b+LTMA97OlSJcBrI+ti1fGocAuJ3 Z3UQzN7AuIQcBszK66yJ6D0+6ZO/sCJbapvIUmPRK3JO69wIsiHt/wVFYVPpU2kD+jnG 93YFURfb3UT+O525BRzEGjOXjkNwOVmme2keY= 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=qwD5lMO+Jv5rC3Vbru4Vtmb8zAHEDsjHqlZgpqUjRR8=; b=hXuyrga7Jymp+bkktpgegw/ZxKQak240HuqX8ZFg2YK5VA0djtWvIFBtZpoPd9YTxD 61KsCgyrhIieYGwpUEzbed4gO9CRCd80vT0QQ7BYvMRxfp4TMfN/bX/nT4m2QFY1FWD7 vpq/Mia5kY8R25MbkhZ8QOipJ2HaILt4aklTDX2nfjkY18LFYts7dgrcdTX3WQpu1VQ1 x+IZ8AhG9Cfa2JhJ97xzr4Zcc4bn/MTkhc6JI7hNGdZClVWtRNu5m6+QcSYGpg2rRz4+ 57H0vNdTxgsKhTDirQn3XK/bHtQ5ews3sYqLakO83O+qo9dGa73/KMscOyR9Rf5dyDue vcgg== X-Gm-Message-State: AGRZ1gJ//C2zCR+gYJUdu3Y4ooSbPfh7FcMgEvnzYYmh6zx3OrwKluX3 SxEDg+CqPth+y5dhd1ZAnaRigw== X-Received: by 2002:a1c:c142:: with SMTP id r63-v6mr5951742wmf.72.1540570308899; Fri, 26 Oct 2018 09:11:48 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:d30:71a0:24b4:1c25]) by smtp.gmail.com with ESMTPSA id y16-v6sm11807209wru.18.2018.10.26.09.11.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 26 Oct 2018 09:11:47 -0700 (PDT) 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, Vincent Guittot Subject: [PATCH v5 1/2] sched/fair: move rq_of helper function Date: Fri, 26 Oct 2018 18:11:42 +0200 Message-Id: <1540570303-6097-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540570303-6097-1-git-send-email-vincent.guittot@linaro.org> References: <1540570303-6097-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 d59307e..6806c27 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 798b1af..618b578 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -922,6 +922,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