Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3574456ybd; Tue, 25 Jun 2019 05:05:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaqrCaPkKe0OQgGS4+DCMxtbLe28za58YTxpEKWUDgJrW8k/WO91BRTBW6PES7OHHcDrcC X-Received: by 2002:a17:90a:cb87:: with SMTP id a7mr32559535pju.130.1561464343197; Tue, 25 Jun 2019 05:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561464343; cv=none; d=google.com; s=arc-20160816; b=uC8isS/bJepc0BS5Ns4JIqDg86lE55BgVaeWvNj9kRGQcazO4HVs5B8lZLvJ6xrX8T iwtnVwHqd02TrDzTN1MoLYItPuNBM7X5iv6Qv552yHRRmaadCBys/E3ZSRJdFMmrS6mF baa4ARsJm8UUeuQJmzY5Vrmy6SePZQVDYh0Ev4mek+jA5viorBRcvQQ3vM7jrKh87IUT FcZuIe0RjnNOJkHT9MJSOdgu00l+edrQdCmzgVQf/NoVFLHMQW8KanL6ddsOnqM41PGX rdq5A3jN3YlbgIxhn3Ay7uL6A8fIT3acW6WD28l3Ev27yOUl3ruo5dM34wyQ+J9Xbo7R QM9g== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=hYBAYhh4oC0BCyLZe9uiClBHp7HJcIibunUV5pp/Qoo=; b=PAy7e2nCEWxPklE6WiJJ/zex/sBWBWnZh7dsWnjQip+XJYOTiCTCasP5Vk6BEfe2Jt BSd8nDnZM6P46CiGt3SUuaQ9au/UFW5A8+qH+EFllfXwP6KE4K3Lqmyoi+nj7MyTyJW+ amkh/1XCLqCt9b/XunmEXWsdz248vPw6SLnDSrM7TRnSgwsU19HZDonyA4OmdvcAS7zB NsJfdAsFD1Auqew5gCkLvYb4a1twiS2xK2NYg8I4mkxQ34tPgwXmrHrd6p8G0oh3dNiG cMkOyf8yfvCY4/R/N+PsYhnY2qA3piL5pEtPjOBFEf+R9Y8fCvFJhEVjVqTHythKAJ4W AbVA== 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 m5si216394plt.167.2019.06.25.05.05.04; Tue, 25 Jun 2019 05:05:43 -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; 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 S1728775AbfFYJu1 (ORCPT + 99 others); Tue, 25 Jun 2019 05:50:27 -0400 Received: from foss.arm.com ([217.140.110.172]:37266 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbfFYJu1 (ORCPT ); Tue, 25 Jun 2019 05:50:27 -0400 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 7CC61360; Tue, 25 Jun 2019 02:50:26 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.194.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B62A43F71E; Tue, 25 Jun 2019 02:50:24 -0700 (PDT) Subject: Re: [PATCH 8/8] sched,fair: flatten hierarchical runqueues To: Rik van Riel , peterz@infradead.org Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, kernel-team@fb.com, morten.rasmussen@arm.com, tglx@linutronix.de, dietmar.eggeman@arm.com, mgorman@techsingularity.com, vincent.guittot@linaro.org References: <20190612193227.993-1-riel@surriel.com> <20190612193227.993-9-riel@surriel.com> From: Dietmar Eggemann Message-ID: <960c2571-7a32-f7aa-08ca-07f1136e835d@arm.com> Date: Tue, 25 Jun 2019 11:50:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190612193227.993-9-riel@surriel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/12/19 9:32 PM, Rik van Riel wrote: [...] > @@ -410,6 +412,11 @@ static inline struct sched_entity *parent_entity(struct sched_entity *se) > return se->parent; > } > > +static inline bool task_se_in_cgroup(struct sched_entity *se) > +{ > + return parent_entity(se); > +} IMHO, s/in_cgroup/not_in_root_tg/ reads easier. "/", i.e. the root tg is still a cgroup, I guess. But you could use existing parent_entity(se) as well. [...] > @@ -679,22 +710,16 @@ static inline u64 calc_delta_fair(u64 delta, struct sched_entity *se) > static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) > { > u64 slice = sysctl_sched_latency; > + struct load_weight *load = &cfs_rq->load; > + struct load_weight lw; > > - for_each_sched_entity(se) { > - struct load_weight *load; > - struct load_weight lw; > + if (unlikely(!se->on_rq)) { > + lw = cfs_rq->load; > > - cfs_rq = cfs_rq_of(se); > - load = &cfs_rq->load; > - > - if (unlikely(!se->on_rq)) { > - lw = cfs_rq->load; > - > - update_load_add(&lw, se->load.weight); > - load = &lw; > - } > - slice = __calc_delta(slice, se->load.weight, load); > + update_load_add(&lw, task_se_h_load(se)); > + load = &lw; > } > + slice = __calc_delta(slice, task_se_h_load(se), load); task_se_h_load(se) and se->load.weight are off my factor of >= 1024 on 64bit. ... bash pid=3250: task_se_h_load(se)=1023 se->load.weight=1048576 sysctl_sched_latency=18000000 slice=0 old_slice=17999995 ... [...]