From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting Date: Thu, 14 Mar 2019 14:32:11 +0100 Message-ID: <20190314133211.GJ5996@hirez.programming.kicks-ass.net> References: <20190208100554.32196-1-patrick.bellasi@arm.com> <20190208100554.32196-2-patrick.bellasi@arm.com> <20190313134022.GB5922@hirez.programming.kicks-ass.net> <20190313161229.pkib2tmjass5chtb@e110439-lin> <20190313194838.GS2482@worktop.programming.kicks-ass.net> <20190314121315.juqpsqu5cwouuqpp@e110439-lin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190314121315.juqpsqu5cwouuqpp@e110439-lin> Sender: linux-kernel-owner@vger.kernel.org To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan List-Id: linux-api@vger.kernel.org On Thu, Mar 14, 2019 at 12:13:15PM +0000, Patrick Bellasi wrote: > > I'd be most impressed if they pull this off. Check the generated code > > and see I suppose :-) > > On x86 the code generated looks exactly the same: > > https://godbolt.org/z/PjmA7k Argh, they do mult by inverse to avoid the division, and can do this because its a constant. And then yes, your arm version looks worse. It does what I expected with -Os, but as Rutland said the other day, that stands for Optimize for Sadness.