lkml.org 
[lkml]   [2010]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/3] [kidled]: introduce kidled.
From
On Wed, Apr 14, 2010 at 2:49 AM, Andi Kleen <andi@firstfloor.org> wrote:
> Salman <sqazi@google.com> writes:
>> +
>> +static int proc_stats(struct ctl_table *table, int write,
>> +                   void __user *buffer, size_t *lenp, loff_t *ppos)
>> +{
>> +     int ret;
>> +     unsigned long stats[3];
>> +     int cpu = (int)((long)table->extra1);
>> +     struct ctl_table fake = {};
>> +
>> +     if (write)
>> +             return -EINVAL;
>> +
>> +     fake.data = stats;
>> +     fake.maxlen = 3*sizeof(unsigned long);
>> +
>> +     ret = smp_call_function_single(cpu, getstats, &stats, 1);
>> +     if (ret)
>> +             return ret;
>
> Haven't read the whole thing, but do any of these stats really
> need to execute on the target CPU? They seem to be just readable
> fields.

To capture all the quantities for a CPU atomically, they must be read
on the CPU. Basically, reading them on that CPU prevents them from
changing as we read them.

Also, if the CPU is idle (injected or otherwise), the quantities won't
get updated.

>
> Or does it simply not matter because this proc call is too infrequent?

It should be infrequent. The idle cycle injector does all the hard
work. These interfaces are for monitoring.

>
> Anyways global broadcasts are discouraged, there is typically
> always someone who feels their RT latency be messed up by them.


I will look at it one more time to see if there is something else that
can be done.

>
> -Andi
>
>
> --
> ak@linux.intel.com -- Speaking for myself only.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-04-14 17:45    [W:1.338 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site