From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Fernandes Subject: Re: [RFC PATCH 5/6] sched/fair: Select an energy-efficient CPU on task wake-up Date: Fri, 23 Mar 2018 23:06:11 -0700 Message-ID: References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-6-dietmar.eggemann@arm.com> <20180321153518.GC13951@e110439-lin> <20180323154745.GP4589@e105550-lin.cambridge.arm.com> <20180324013421.GB1317@queper01-VirtualBox> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20180324013421.GB1317@queper01-VirtualBox> Sender: linux-kernel-owner@vger.kernel.org To: Quentin Perret , Joel Fernandes Cc: Morten Rasmussen , Patrick Bellasi , Dietmar Eggemann , LKML , Peter Zijlstra , Thara Gopinath , Linux PM , Chris Redpath , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos List-Id: linux-pm@vger.kernel.org On March 23, 2018 6:34:22 PM PDT, Quentin Perret wrote: >On Friday 23 Mar 2018 at 18:13:56 (-0700), Joel Fernandes wrote: >> Hi Morten, >>=20 >> On Fri, Mar 23, 2018 at 8:47 AM, Morten Rasmussen >> wrote: >> > On Thu, Mar 22, 2018 at 01:10:22PM -0700, Joel Fernandes wrote: > >[=2E=2E=2E] > >> > You mean if SD_BALANCE_WAKE isn't set on sched_domains? >>=20 >> Yes=2E >>=20 >> > The current code seems to rely on that flag to be set to work >correctly=2E >> > Otherwise, the loop might bail out on !want_affine and we end up >doing >> > the find_energy_efficient_cpu() on the lowest level sched_domain >even if >> > there is higher level one which isn't over-utilized=2E >> > >> > However, SD_BALANCE_WAKE should be set if SD_ASYM_CPUCAPACITY is >set so >> > sd =3D=3D NULL shouldn't be possible? This only holds as long as we >only >> > want EAS for asymmetric systems=2E >>=20 >> Yes, I see you had topology code that set SD_BALANCE_WAKE for ASYM=2E >It >> makes sense to me then, thanks for the clarification=2E >>=20 >> Still I feel it is a bit tedious/confusing when reading code to draw >> the conclusion about why sd is checked first before doing >> find_energy_efficient_cpu (and that sd will !=3D NULL for ASYM >systems)=2E >> If energy_sd is set, then we can just proceed with EAS without >> checking that sd !=3D NULL=2E This function in mainline is already pret= ty >> confusing as it is :-( > >Right I see your point=2E The code is correct as is, but I agree that >having >a code structured as > > if (energy_sd) { > new_cpu =3D find_energy_efficient_cpu(energy_sd, p, prev_cpu); > } else if (!sd) { > =2E=2E=2E > >might be easier to understand and functionally equivalent=2E What do you >think ? Yeah definitely=2E Go for it=2E - Joel --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E