Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3638537ybh; Tue, 17 Mar 2020 03:57:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vst93tDIEqoQOefNzub2wq6DGFl/ehmIjiLzsYyJgcobXqONNqEtLZAriNSC81y7/y9QItl X-Received: by 2002:a9d:69c5:: with SMTP id v5mr2975268oto.228.1584442642955; Tue, 17 Mar 2020 03:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584442642; cv=none; d=google.com; s=arc-20160816; b=RSGDksOcuEbTekT1Qb0IpOM6peIBDQ+NjX5khYZfXxnCxE4wYfTBivrMrL5frmnyPq g0qF4ae/P42h+XVH6PBXOVt8ui8FQtit2sfhOSOf+eGMB7RR5u2vB0oqS9U8e3KpABQP SVqIv1yEUl2tO1BnVOEll6/QkcktNRRmGinQIEc/e8d3YypaWDsoxwHQz70UHrsdmrmp qFV3LFWh/s7azZHGrV9JaQOAim7sVyiHdyWdLenuRNaDjWqYARBVV1A/MYhNx0xKy5nM QWCZwfqX83za7IpDqI5ZyHtEPISj6IO9vok+e3xV8GJPCfazKG1rIZ0GayNXVmdMwzOJ n6AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=udDOqWEe/EManpbCzzq2k7n3B8Gc0fxFYynvLpdNVQw=; b=X5RzqxF5ApaKOA5gRUMi0y7Cktb0O4rZjq5lbavRjtyuio62Raciu10Zom7Yt+deVi Lzvd2Wcd/EEfVFh55+dwPVY2RQFIPGAlnyjWxKqTYjsXi1z+4aASTAC1RuO8ND7L+kIR nBO26UPeLuh3nP4cl0ikUUua1rQrDpwFIXykX3n8dxEtHwdWFHA4Mr2TLoJj5+u11B88 /PaoiKzTUZhMBELOIcE2AHgfcRdXS0eG6r8Db4+IZoscTsMM6M3mgYd3zIgyyCsg2+KE gbbqrPTGnA3x2kBCtVO7vhMrzoC3qwEpXSxXd9QnZUamNSY70EkN/FR8TdMTTbRBa2Qr 05Gg== 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 u199si1478239oif.110.2020.03.17.03.57.11; Tue, 17 Mar 2020 03:57: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; 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 S1726696AbgCQK4i (ORCPT + 99 others); Tue, 17 Mar 2020 06:56:38 -0400 Received: from foss.arm.com ([217.140.110.172]:35000 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbgCQK4f (ORCPT ); Tue, 17 Mar 2020 06:56:35 -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 35ECC1FB; Tue, 17 Mar 2020 03:56:35 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D9F4D3F534; Tue, 17 Mar 2020 03:56:33 -0700 (PDT) References: <20200311202625.13629-1-daniel.lezcano@linaro.org> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Daniel Lezcano Cc: peterz@infradead.org, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, linux-kernel@vger.kernel.org, qais.yousef@arm.com Subject: Re: [PATCH V2] sched: fair: Use the earliest break even In-reply-to: <20200311202625.13629-1-daniel.lezcano@linaro.org> Date: Tue, 17 Mar 2020 10:56:11 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, One more comment on the break even itself, ignoring the rest: On Wed, Mar 11 2020, Daniel Lezcano wrote: > diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c > index b743bf38f08f..3342e7bae072 100644 > --- a/kernel/sched/idle.c > +++ b/kernel/sched/idle.c > @@ -19,7 +19,13 @@ extern char __cpuidle_text_start[], __cpuidle_text_end[]; > */ > void sched_idle_set_state(struct cpuidle_state *idle_state) > { > - idle_set_state(this_rq(), idle_state); > + struct rq *rq = this_rq(); > + > + idle_set_state(rq, idle_state); > + > + if (idle_state) > + idle_set_break_even(rq, ktime_get_ns() + > + idle_state->exit_latency_ns); I'm not sure I follow why we go for entry time + exit latency. If this is based on the minimum residency, shouldn't this be something depending on the entry latency? i.e. something like break_even = now + entry_latency + idling_time \_________________________/ min-residency or am I missing something? > } > > static int __read_mostly cpu_idle_force_poll;