lkml.org 
[lkml]   [2008]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] SGI X86 UV: Provide a System Activity Indicator driver
From
Date
Mike Travis <travis@sgi.com> writes:
>
> I do use the timer mechanism (once per second) to update the scir state.
> Unfortunately, the state is *always* not idle during the timer callback
> (since we are actively executing), so I needed some way of knowing the
> idle state prior to the timer callback.

The idle thread always has pid 0. So if the timer sees current->pid == 0
it interrupted idle.

But sampling only once a second would be presumably not very accurate.
You could just check the per cpu statistics the kernel keeps
anyways in the timer.

I agree with Ingo that this doesn't belong in a idle notifier.

-Andi
--
ak@linux.intel.com


\
 
 \ /
  Last update: 2008-10-24 20:15    [from the cache]
©2003-2011 Jasper Spaans