From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755018AbcDTMNV (ORCPT ); Wed, 20 Apr 2016 08:13:21 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37959 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752981AbcDTMNU (ORCPT ); Wed, 20 Apr 2016 08:13:20 -0400 Date: Wed, 20 Apr 2016 14:13:15 +0200 From: Peter Zijlstra To: Daniel Lezcano Cc: rjw@rjwysocki.net, mingo@kernel.org, "open list:CPUIDLE DRIVERS" , open list Subject: Re: [PATCH] cpuidle: Change ktime_get() with local_clock() Message-ID: <20160420121315.GC3408@twins.programming.kicks-ass.net> References: <1460661834-5683-1-git-send-email-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460661834-5683-1-git-send-email-daniel.lezcano@linaro.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 14, 2016 at 09:23:54PM +0200, Daniel Lezcano wrote: > @@ -217,7 +217,11 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, > if (!cpuidle_state_is_coupled(drv, entered_state)) > local_irq_enable(); > > - diff = ktime_to_us(ktime_sub(time_end, time_start)); > + /* > + * local_clock() returns the time in nanosecond, let's shift > + * by 10 (divide by 1024) to have microsecond based time. > + */ > + diff = (time_end - time_start) >> 10; Changelog fails to explain the ramifications of this change...