Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2465316ybv; Mon, 24 Feb 2020 05:48:07 -0800 (PST) X-Google-Smtp-Source: APXvYqydmljWJBnVg5CgVQwHcoOcdIBN9u0VCMj43gV/9kBeNIu7hwEpD3L5GrCc6dxBxtx7cklp X-Received: by 2002:a9d:7a96:: with SMTP id l22mr39829352otn.217.1582552086932; Mon, 24 Feb 2020 05:48:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582552086; cv=none; d=google.com; s=arc-20160816; b=BAjC0yAn7M83hSBDd2/6ViflsfVOaTPDd3x5oSZX3G5sQiqyOmoNYRmGC/4jT9FNrf v7onkofUI89WkhcKUYBiEi4KxjZYe7kN6SkuR1ai9ntgoIjZjSa7A14hrYfzvgyHcp6x vOrMSXVH/SJw52ws+U4zFJAiHh+W5Y68Cn47rmfeYdsDRzu0Zdh2/MmMQT9E3F9QKcV5 6wjuBBdg7PRr6yW0spem9RZRQf2ZzDbtYcKHFAwEpbFtHTzMMdlxQT2pH6+NEy9MhrVw Qh923SAdls2o+T899FVizD2ezAE1p4MS6+CiTGnWoM1Bu5pqnRsM1vdseTdHyeqzGia9 bRJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=dMumJPU+xi3MS7wcUvSk4RER+Gf0Q0YJ4D6wiKBNFhs=; b=c78P5+36ZL6XMA5+zdNZEowIgwkEJREZQxMpsWsvyZo61SY59tJJX1aOJn4q5DPSoD i/0b2Eeb4QkocQQpoabchjC0N9watiWUde+btod7H//2FQthzuxfUAWbcN6AGvI8/c2Y TKSNslp+GD827cF2YLf+5T0DrEpROqov09HtJyBNwkjccCU21gR944O1mZfG1YMThYHR GdfEHOECTDvA3vb3mG0ufa7IQ1YQ2VwpxGiWKkaD3jmQE7IAAtj9pkzcpfjB1FKxHhFP tEHtTROxK2wGYGrhgFF+pLPM4cT34TX7DVoIG0fku5kOH4wUGfhJlD2HDDHWwJW9CbTa qbgw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si6810112otm.88.2020.02.24.05.47.51; Mon, 24 Feb 2020 05:48:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbgBXNra (ORCPT + 99 others); Mon, 24 Feb 2020 08:47:30 -0500 Received: from foss.arm.com ([217.140.110.172]:37300 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgBXNra (ORCPT ); Mon, 24 Feb 2020 08:47:30 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7C6EE30E; Mon, 24 Feb 2020 05:47:29 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A7993F534; Mon, 24 Feb 2020 05:47:28 -0800 (PST) Date: Mon, 24 Feb 2020 13:47:25 +0000 From: Qais Yousef To: Dietmar Eggemann Cc: Ingo Molnar , Peter Zijlstra , Steven Rostedt , Pavan Kondeti , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 6/6] sched/rt: Remove unnecessary assignment in inc/dec_rt_migration Message-ID: <20200224134725.lnccpprgrx5rj4di@e107158-lin.cambridge.arm.com> References: <20200223184001.14248-1-qais.yousef@arm.com> <20200223184001.14248-7-qais.yousef@arm.com> <20200224123123.gbox3tcqcist7bbg@e107158-lin.cambridge.arm.com> <90e4af9c-b4e3-00bf-ebe6-5d4fe6f892aa@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <90e4af9c-b4e3-00bf-ebe6-5d4fe6f892aa@arm.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/24/20 13:03, Dietmar Eggemann wrote: > On 24.02.20 12:31, Qais Yousef wrote: > > On 02/24/20 00:16, Dietmar Eggemann wrote: > >> On 23.02.20 19:40, Qais Yousef wrote: > > [...] > > >>> - rt_rq = &rq_of_rt_rq(rt_rq)->rt; > >> > >> IMHO, this is here to get the root rt_rq from any rt_rq (task_groups). > >> Looks like that e.g rt_nr_total is only maintained on root rt_rq's. > >> > >> Similar to CFS' &rq_of(cfs_rq)->cfs (cfs_rq_util_change()) to get root > >> cfs_rq. > >> > >> Not sure where CONFIG_RT_GROUP_SCHED=y is used but it's part of the rt > >> class implementation. > > > > Ah I see. That was obvious.. How about the below comment? > > > > This code is executed only if rt_entity_is_task(), I don't think this grantees > > that the rt_rq isn't for a group? > > No, an rt task can run in this taskgroup (e.g. "/tg/tg1"), i.e. in > tg1->rt_rq[cpu]. > > The taskgroup skeleton rt_se of e.g. "/tg/tg1/tg11" would also run in > tg1->rt_rq[cpu] but for those rt_se's we bail out of [inc/dec]_rt_migration. > > > > > I need to go and unravel the layers maybe. > > > > Thanks! > > > > -- > > Qais Yousef > > > > -->8-- > > > > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > > index b35e49cdafcc..f929867215c4 100644 > > --- a/kernel/sched/rt.c > > +++ b/kernel/sched/rt.c > > @@ -343,6 +343,8 @@ static void inc_rt_migration(struct sched_rt_entity *rt_se, struct rt_rq *rt_rq) > > return; > > > > p = rt_task_of(rt_se); > > + > > + /* get the root rt_rq if this is the rt_rq of a group */ > > Not sure if a comment like this will help since: > > (a) the definition of rq_of_rt_rq() for the !CONFIG_RT_GROUP_SCHED case > > (b) rt_rq might already be the root rt_rq in case the task runs in "/" I thought the comment explains that. FWIW I don't think someone looking at the code need to look at rq_of_rt_rq() to get the dependency, but if the above doesn't help I have no better suggestion. So I'll drop it. Thanks -- Qais Yousef