linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salman Qazi <sqazi@google.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: peterz@infradead.org, mingo@elte.hu,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	svaidy@linux.vnet.ibm.com, linux-pm@lists.linux-foundation.org,
	arjan@infradead.org, csadler@google.com, ranjitm@google.com,
	kenchen@google.com, dawnchen@google.com
Subject: Re: [PATCH 1/3] [kidled]: introduce kidled.
Date: Wed, 14 Apr 2010 08:41:30 -0700	[thread overview]
Message-ID: <o2y4352991a1004140841w7f37b84cnedcd91c2638a07ea@mail.gmail.com> (raw)
In-Reply-To: <87fx2y9xdn.fsf@basil.nowhere.org>

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.
>

  reply	other threads:[~2010-04-14 15:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  0:08 [PATCH 0/3] [idled]: Idle Cycle Injector for power capping Salman
2010-04-14  0:08 ` [PATCH 1/3] [kidled]: introduce kidled Salman
2010-04-14  9:49   ` Andi Kleen
2010-04-14 15:41     ` Salman Qazi [this message]
2010-04-15  7:46       ` Peter Zijlstra
2010-04-14  0:08 ` [PATCH 2/3] [kidled]: Add eager injection Salman
2010-04-14  0:08 ` [PATCH 3/3] [kidled]: Introduce power capping priority and LB awareness Salman
2010-04-15  7:51 ` [PATCH 0/3] [idled]: Idle Cycle Injector for power capping Peter Zijlstra
2010-04-17 17:08   ` tytso
2010-04-17 17:57     ` Arjan van de Ven
2010-04-17 19:51     ` Peter Zijlstra
2010-04-19 17:20   ` Salman Qazi
2010-04-19 19:01     ` Peter Zijlstra
2010-04-20  1:00       ` Arjan van de Ven
2010-04-20  5:00         ` Vaidyanathan Srinivasan
2010-04-20  4:50       ` Vaidyanathan Srinivasan
2010-04-20 17:52         ` Salman Qazi
2010-04-21  5:08           ` Arjan van de Ven
2010-04-22  1:32   ` Mike Chan
2010-04-22  8:21     ` Peter Zijlstra
2010-04-22 19:02     ` Vaidyanathan Srinivasan
2010-04-17 16:40 ` Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=o2y4352991a1004140841w7f37b84cnedcd91c2638a07ea@mail.gmail.com \
    --to=sqazi@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=csadler@google.com \
    --cc=dawnchen@google.com \
    --cc=kenchen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=ranjitm@google.com \
    --cc=svaidy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).