Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2330941imm; Fri, 7 Sep 2018 14:48:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZkePFA6182iqNoGDexqdttQVeBOTu7f51dNlRxQPvuV3M4ujgJUOCFmxyVPlomjpZZ6dLa X-Received: by 2002:a62:c9:: with SMTP id 192-v6mr10631497pfa.99.1536356902412; Fri, 07 Sep 2018 14:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356902; cv=none; d=google.com; s=arc-20160816; b=pkIPFUrZLn/O0vDU5K//z6tCssTUPyPX6c/+ZC1ILhci7d/wjsZt4ivHQCxA7ENK+L uZ3okvkyiyq+kK6OuRmnNuMVe9qD8mrYwzIzyo2bOFyoqbiYWDpmrEn3Wc0z+/jjtESe eHKqCEqlQmzl2K6AYf4AIzPXvFZA8E509FRE9kzq3Oa/CgOyigyeyW97Vu8PMH1Ao4bj 6dwhXkpyQTUFHhOuHzDJX34oIaqhu76/uBw7tEaNZIFBO7sQksxGH2BLjf8yfhJsfVQ6 NeUiBON94hC7Xn7gLMYa6DOixJJ4J5QF+vPHhDLn4B1+XH0ILFdsWS+qF/Quq3yzViZ7 fYBw== 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=iU8DLPETpFbm7PekMxidV/bd2shUB/iA98d0tAkCYxk=; b=g03AdseoPBMe767JmKKYscqligFQX7XbqRgEAQiso7Si01/ZFE6DlUe9SUBGehks5e VT14awIflHoeVWaLjqq8QAQblwycNWJQjhcPgo1hrPzTRZV0mAngkaxkRC35i7WFR5MB f3AKHbv5UURDzhqDKVzZh6XayMAOEfIrt5nNQ1b9GXkzWhF6n5Fs6k9/DSyQPlaSO0dI t3nI5DZ8ThKpQGPpnuIhVVIb8SDL89lC6lOWOM/noU1nzlHPdVk7T4YiSKx80axVo5Hm vxkFThKJoqJKdczi0ehBgVO8nx1NUtl1+IblNyHbr2xds1tUH/9Qp7gkPnKZV1oxKYIt yj6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b="YWg/0cns"; 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 17-v6si9323419pgw.648.2018.09.07.14.48.07; Fri, 07 Sep 2018 14:48:22 -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="YWg/0cns"; 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 S1731196AbeIHC2w (ORCPT + 99 others); Fri, 7 Sep 2018 22:28:52 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:12694 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728133AbeIHC2v (ORCPT ); Fri, 7 Sep 2018 22:28:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1536356756; x=1567892756; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iU8DLPETpFbm7PekMxidV/bd2shUB/iA98d0tAkCYxk=; b=YWg/0cnsD1CFpmXt/Rf2Yz74E0GZr0xKyYz5rIjavsOdlkOJN0HdSEtB lsXUh1MTPP7Ofzzrk+F1iG8weqq4XeMKMQmcmmcjvLHJMtncWymm+zz9r jZ9e4WHmkzv9YgIq9jI/hES77VuCkzZSWiMkQNTY+lJ9Q6NPRY4PMdWp0 w=; X-IronPort-AV: E=Sophos;i="5.53,343,1531785600"; d="scan'208";a="752286750" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2a-53356bf6.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Sep 2018 21:43:24 +0000 Received: from u7588a65da6b65f.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2a-53356bf6.us-west-2.amazon.com (8.14.7/8.14.7) with ESMTP id w87LgI6C074882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 7 Sep 2018 21:42:20 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 w87LgHsm027504 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Sep 2018 23:42:17 +0200 Received: (from jschoenh@localhost) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Submit) id w87LgGn7027500; Fri, 7 Sep 2018 23:42:16 +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 32/60] cosched: Specialize parent_cfs_rq() for hierarchical runqueues Date: Fri, 7 Sep 2018 23:40:19 +0200 Message-Id: <20180907214047.26914-33-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 Make parent_cfs_rq() coscheduling-aware. Signed-off-by: Jan H. Schönherr --- kernel/sched/fair.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8504790944bf..8cba7b8fb6bd 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -284,12 +284,25 @@ static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp) return grp->my_q; } +#ifdef CONFIG_COSCHEDULING +static inline struct cfs_rq *parent_cfs_rq(struct cfs_rq *cfs_rq) +{ + /* + * Only return TG parent (if valid), don't switch levels. + * Callers stay or expect to stay within the same level. + */ + if (!cfs_rq->sdrq.tg_parent || !cfs_rq->sdrq.is_root) + return NULL; + return cfs_rq->sdrq.tg_parent->cfs_rq; +} +#else /* !CONFIG_COSCHEDULING */ static inline struct cfs_rq *parent_cfs_rq(struct cfs_rq *cfs_rq) { if (!cfs_rq->tg->parent) return NULL; return cfs_rq->tg->parent->cfs_rq[cpu_of(rq_of(cfs_rq))]; } +#endif /* !CONFIG_COSCHEDULING */ static inline void list_add_leaf_cfs_rq(struct cfs_rq *cfs_rq) { -- 2.9.3.1.gcba166c.dirty