From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936184AbdKPQvV (ORCPT ); Thu, 16 Nov 2017 11:51:21 -0500 Received: from us-smtp-delivery-107.mimecast.com ([216.205.24.107]:32770 "EHLO us-smtp-delivery-107.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936205AbdKPQvN (ORCPT ); Thu, 16 Nov 2017 11:51:13 -0500 X-MC-Unique: Db1GZLvMPWa0Tv1zmEMwFQ-1 Subject: Re: [RFC] Improving udelay/ndelay on platforms where that is possible To: Nicolas Pitre CC: Russell King - ARM Linux , Linus Torvalds , Alan Cox , LKML , Linux ARM , Steven Rostedt , Ingo Molnar , Thomas Gleixner , "Peter Zijlstra" , John Stultz , Douglas Anderson , Mark Rutland , Will Deacon , Jonathan Austin , Arnd Bergmann , Kevin Hilman , Michael Turquette , "Stephen Boyd" , Boris Brezillon , Thibaud Cornic , Mason References: <20171101175325.2557ce85@alans-desktop> <4b707ce0-6067-ab36-e167-1acf348d26bf@free.fr> <11393e07-b042-180c-3bcd-484bf51eada6@sigmadesigns.com> <20171115131351.GE31757@n2100.armlinux.org.uk> <1fa81694-7bd2-564b-e5b9-ae53b9ea6620@sigmadesigns.com> <20171116153625.GJ31757@n2100.armlinux.org.uk> <9a4cfa9d-3940-b7f2-5a4d-59e89af85bb7@sigmadesigns.com> <48c38055-20f7-e565-aa56-74f360e6e3d9@sigmadesigns.com> From: Marc Gonzalez Message-ID: <870aeb80-bbc5-52ed-cca2-3e762e27bfe2@sigmadesigns.com> Date: Thu, 16 Nov 2017 17:51:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.27.0.114] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/11/2017 17:47, Nicolas Pitre wrote: > Look at cpufreq_callback() in arch/arm/kernel/smp.c. Are you pointing at the scaling of loops_per_jiffy done in that function? As I wrote earlier: If I'm reading arch/arm/kernel/smp.c correctly, loops_per_jiffy is scaled when the frequency changes. But arch/arm/lib/delay-loop.S starts by loading the current value of loops_per_jiffy, computes the number of times to loop, and then loops. If the frequency increases when the core is in __loop_delay, the delay will be much shorter than requested.