Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2330448imm; Fri, 7 Sep 2018 14:47:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbuMDE9dASo3Jhxz1UJBIaRLEROrF/yF3+rVqfjcAM2PjX0psicyiL8aSaHdt9ISqT+nCZs X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr10114232pla.291.1536356869299; Fri, 07 Sep 2018 14:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356869; cv=none; d=google.com; s=arc-20160816; b=OE4tNBlFExKx5DMmWTkWS+d7gi24bXc/hdh8ZOEow0Nuhqpo/5BTofQljuI6hVK0qi XOOFoAZfDvHoagu0trlDEAHqGas7lpgr7nY3wRXNoFy0QT26sBERcBh2unstq7AO5tX/ 8+eSiley73qyYUote/kvu7VJnO9gaakIBPzpCnCUzbtFDvsQ8t5VxCFjTNeI2KQPe+x8 A5nkTcv1JJ7CWNzRm7RaxHCc8NSTEOUj3g3nfW2/9TBmxTPW/A7TKQScuJ7oNcJAc0yQ 1o4MHLAAJ1dw/F/BrPyXCC3+TLSCXHjXSud+NHEnHNuqHG5e1L3d8aMjHqx929YJTziR RnMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9jSdII5XYgMwyKZmnZkG1NLLVn+DiYke8PMRuChFkl4=; b=syVtf7eLOvFccEjV+s+tB0tnddUG+ZDDFypzxBff5hgC9s0K6tq+dUos29faUzTNOG dEEb0Lo5ejMnytRcHCaf8wbrp4UIpmcsgDmLjt9+lHRXAulNliOBwhwFMGys+vFMRVWQ 2D3AMqasoge7+YXfYqfra359dqM/vDXO/JEYvhWRSfbIOBm3LGyplHWRk1xfb/Qe0v4q BBRAYVzlHYttiFO0ot9hSPfR9hFRXxrpkKMjEbkaommdgBVGQNUwjTboRmva7ceB4147 HAy8FbckRiCyAo9OllOcajHFZZs/GpHUDpwN2u7HNu3gnYrREmyRFxRe3N96qccnHCYf L/gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=aA1i0PZo; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2-v6si9454420pgj.391.2018.09.07.14.47.34; Fri, 07 Sep 2018 14:47:49 -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=@amazon.de header.s=amazon201209 header.b=aA1i0PZo; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731181AbeIHC2l (ORCPT + 99 others); Fri, 7 Sep 2018 22:28:41 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:13460 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730028AbeIHC2k (ORCPT ); Fri, 7 Sep 2018 22:28:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1536356745; x=1567892745; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9jSdII5XYgMwyKZmnZkG1NLLVn+DiYke8PMRuChFkl4=; b=aA1i0PZoDFvs5WNFBYLeIXqQv5W4anii04wU07A9S9Boc+vbDjEy2CE/ Rm/6+xHbC8/lm4x3CJsvk4WvPS8GkWw2fsFsALq/L6H+Bb1wUL8Ggiabw IFdX9S9z3lsrLymROxX42EpzpolyHnDbE4UgctB7Q0Zmh1QjU8IeNcFi9 c=; X-IronPort-AV: E=Sophos;i="5.53,343,1531785600"; d="scan'208";a="629734606" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1d-9ec21598.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Sep 2018 21:43:13 +0000 Received: from u7588a65da6b65f.ant.amazon.com (iad7-ws-svc-lb50-vlan3.amazon.com [10.0.93.214]) by email-inbound-relay-1d-9ec21598.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w87Lg9vh020494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 7 Sep 2018 21:42:12 GMT Received: from u7588a65da6b65f.ant.amazon.com (localhost [127.0.0.1]) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTPS id w87Lg83U027447 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Sep 2018 23:42:08 +0200 Received: (from jschoenh@localhost) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Submit) id w87Lg7QB027446; Fri, 7 Sep 2018 23:42:07 +0200 From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= To: Ingo Molnar , Peter Zijlstra Cc: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= , linux-kernel@vger.kernel.org Subject: [RFC 27/60] cosched: Add some small helper functions for later use Date: Fri, 7 Sep 2018 23:40:14 +0200 Message-Id: <20180907214047.26914-28-jschoenh@amazon.de> X-Mailer: git-send-email 2.9.3.1.gcba166c.dirty In-Reply-To: <20180907214047.26914-1-jschoenh@amazon.de> References: <20180907214047.26914-1-jschoenh@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Jan H. Schönherr --- kernel/sched/sched.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index d65c98c34c13..456b266b8a2c 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1130,6 +1130,40 @@ static inline struct cfs_rq *taskgroup_next_cfsrq(struct task_group *tg, #endif /* CONFIG_FAIR_GROUP_SCHED */ #ifdef CONFIG_COSCHEDULING +static inline int node_of(struct rq *rq) +{ + return rq->sdrq_data.numa_node; +} + +static inline bool is_cpu_rq(struct rq *rq) +{ + return !rq->sdrq_data.level; +} + +static inline struct rq *parent_rq(struct rq *rq) +{ + if (!rq->sdrq_data.parent) + return NULL; + return container_of(rq->sdrq_data.parent, struct rq, sdrq_data); +} +#else /* !CONFIG_COSCHEDULING */ +static inline int node_of(struct rq *rq) +{ + return cpu_to_node(cpu_of(rq)); +} + +static inline bool is_cpu_rq(struct rq *rq) +{ + return true; +} + +static inline struct rq *parent_rq(struct rq *rq) +{ + return NULL; +} +#endif /* !CONFIG_COSCHEDULING */ + +#ifdef CONFIG_COSCHEDULING void cosched_init_bottom(void); void cosched_init_topology(void); void cosched_init_hierarchy(void); -- 2.9.3.1.gcba166c.dirty