Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp375793ybh; Wed, 18 Mar 2020 01:26:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuCmNQ5wQ/RshfTWDrWwrNi6urc8kr09zs9uCbg7jgf6+6ptqtAlU/cEf/HRRTEwk+Ju33j X-Received: by 2002:a05:6830:1697:: with SMTP id k23mr3012540otr.155.1584519995921; Wed, 18 Mar 2020 01:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584519995; cv=none; d=google.com; s=arc-20160816; b=JZXYXxI2rE4oOWL/sOe5bChvs+bzKlz1b2umKcKY3P42gKczofaVRah2LD46Mz6Kig kz9O8zyO6j91EkU9arF9zNH4Mrkfkff4Ev4CBcdEORVgn1LHsQ9eCNc/GT4xMMv6TJ92 bjGk1GlSzwivY60fDYg8ZlVZEVHx6chCNwKC0NtM6mfD+k0c1zsBIZYagVwj6zy5dIUh 174Qhct/qrMM3bfYC9dxrbZppehQ8aNxcvnYEkGR3+Q14+H2w+xyTh8pF8NbCJGkMEI2 rSraQHFZGk2Ixt66Bfsa62D2PkWY3co9z5RQhA0Tkdv8dQ5WR5sv5t5IhYnNTrQF198W 3XcA== 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=oGqdwVZN3Gvp9sJdUU+vY5lBHUWUVvVOgFrJoaqogbc=; b=flYAbUYOpUigvce53TvBkJSfKJ5zh2yCMhR0+cedL9COt+AfZUVObmv+oKgk7iwmYd sA/NBFNlfqX4W5UDmEqABhbIni1kUVZd/91GiLqVC9alme+tyn4L7MFcdxjSBhEnVCtJ fT/5BmFkjoXTTDTVJGZNmuEtPdlfwjuuuYOTZlJwTr37bRtSUTGc4edDJEqysWQIWsWv 4Xpk2VOU7Q6AHi/pI31eWlfK/csxDlkVmWOfomxGFZIyaRzj9Ye8PbVbEUH/7MhUIaxb WZUr1IoiLAVAkPZri69nOT825MFsbHU/E1BCFEKurjqwgdWMKZkhYlh2UIjV/FyA9wGD CIAQ== 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 63si3086934otm.66.2020.03.18.01.26.23; Wed, 18 Mar 2020 01:26:35 -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 S1727281AbgCRIZA (ORCPT + 99 others); Wed, 18 Mar 2020 04:25:00 -0400 Received: from foss.arm.com ([217.140.110.172]:46606 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726550AbgCRIZA (ORCPT ); Wed, 18 Mar 2020 04:25:00 -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 0A8D231B; Wed, 18 Mar 2020 01:25:00 -0700 (PDT) Received: from e123083-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 47BC23F52E; Wed, 18 Mar 2020 01:24:58 -0700 (PDT) Date: Wed, 18 Mar 2020 09:24:52 +0100 From: Morten Rasmussen To: Daniel Lezcano Cc: Vincent Guittot , Peter Zijlstra , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , linux-kernel , Qais Yousef , Valentin Schneider Subject: Re: [PATCH V2] sched: fair: Use the earliest break even Message-ID: <20200318082452.GA6103@e123083-lin> References: <20200311202625.13629-1-daniel.lezcano@linaro.org> <20200317075607.GE10914@e105550-lin.cambridge.arm.com> <3520b762-08f5-0db8-30cb-372709188bb9@linaro.org> <20200317143053.GF10914@e105550-lin.cambridge.arm.com> <7cd04d35-3522-30fb-82e9-82fdf53d0957@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7cd04d35-3522-30fb-82e9-82fdf53d0957@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2020 at 06:07:43PM +0100, Daniel Lezcano wrote: > On 17/03/2020 15:30, Morten Rasmussen wrote: > > On Tue, Mar 17, 2020 at 02:48:51PM +0100, Daniel Lezcano wrote: > >> On 17/03/2020 08:56, Morten Rasmussen wrote: > >>> On Thu, Mar 12, 2020 at 11:04:19AM +0100, Daniel Lezcano wrote: > >>>>>> In order to be more energy efficient but without impacting the > >>>>>> performances, let's use another criteria: the break even deadline. > >>>>>> > >>>>>> At idle time, when we store the idle state the CPU is entering in, we > >>>>>> compute the next deadline where the CPU could be woken up without > >>>>>> spending more energy to sleep. > >>> > >>> I don't follow the argument that sleeping longer should improve energy > >>> consumption. > >> > >> May be it is not explained correctly. > >> > >> The patch is about selecting a CPU with the smallest break even deadline > >> value. In a group of idle CPUs in the same idle state, we will pick the > >> one with the smallest break even dead line which is the one with the > >> highest probability it already reached its target residency. > >> > >> It is best effort. > > > > Indeed. I get what the patch does, I just don't see how the patch > > improves energy efficiency. > > If the CPU is woken up before it reached the break even, the idle state > cost in energy is greater than the energy it saved. > > Am I misunderstanding your point? Considering just the waking then yes, it reaches energy break-even. However, considering all the CPUs in the system, it just moves the idle entry/exit energy cost to a different CPU, it doesn't go away. Whether you have: |-BE-| ____ ____ CPU0: ___/ \__/ \___ CPU1: ____________________ Or: |-BE-| ____ CPU0: ___/ \___________ ____ CPU1: ___________/ \___ _ = CPU busy = P_{busy} _ = CPU idle = P_{idle} / = CPU idle exit = P_{exit} \ = CPU idle entry = P_{entry} The sum of areas under the curves is the same, i.e. the total energy is unchanged. Morten