From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932850AbXIAWYH (ORCPT ); Sat, 1 Sep 2007 18:24:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757151AbXIAWX4 (ORCPT ); Sat, 1 Sep 2007 18:23:56 -0400 Received: from cantor.suse.de ([195.135.220.2]:45806 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756976AbXIAWXz (ORCPT ); Sat, 1 Sep 2007 18:23:55 -0400 To: Venki Pallipadi Cc: Thomas Gleixner , Andrew Morton , Ingo Molnar , linux-kernel Subject: Re: [PATCH] Track accurate idle time with tick_sched.idle_sleeptime References: <20070827215611.GA30396@linux-os.sc.intel.com> From: Andi Kleen Date: 02 Sep 2007 00:23:53 +0200 In-Reply-To: <20070827215611.GA30396@linux-os.sc.intel.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Venki Pallipadi writes: > > +void tick_nohz_stop_idle(int cpu) > +{ > + struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); > + > + if (ts->idle_active) { > + ktime_t now, delta; > + now = ktime_get(); That could be PM timer read costing thousands of cycles. For going into idle it's probably not a real problem, but it could seriously affect out of idle latencies. You would really need a cheaper per CPU timer that doesn't stop in idle (which rules out sched_clock). It's all unfortunately quite messy. -Andi