From: Andi Kleen <ak@muc.de>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Reduce cacheline bouncing in cpu_idle_wait
Date: Thu, 10 Mar 2005 09:51:22 +0100 [thread overview]
Message-ID: <m1mztbvq7p.fsf@muc.de> (raw)
In-Reply-To: <Pine.LNX.4.61.0503091839200.2903@montezuma.fsmlabs.com> (Zwane Mwaikambo's message of "Wed, 9 Mar 2005 19:41:35 -0700 (MST)")
Zwane Mwaikambo <zwane@arm.linux.org.uk> writes:
> Andi noted that during normal runtime cpu_idle_map is bounced around a
> lot, and occassionally at a higher frequency than the timer interrupt
> wakeup which we normally exit pm_idle from. So switch to a percpu
> variable. Andi i didn't move things to the slow path because it would
> involve adding scheduler code to wakeup the idle thread on the cpus we're
> waiting for.
Thanks.
>
> -
> void cpu_idle_wait(void)
> {
> - int cpu;
> - cpumask_t map;
> + unsigned int cpu, this_cpu = get_cpu();
> + cpumask_t map;
> +
> + set_cpus_allowed(current, cpumask_of_cpu(this_cpu));
> + put_cpu();
You need a cpus_clear(map); here I think (probably same for the other
archs)
> +
> + for_each_online_cpu(cpu) {
> + per_cpu(cpu_idle_state, cpu) = 1;
> + cpu_set(cpu, map);
> + }
-Andi
next prev parent reply other threads:[~2005-03-10 8:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-10 2:41 [PATCH] Reduce cacheline bouncing in cpu_idle_wait Zwane Mwaikambo
2005-03-10 8:51 ` Andi Kleen [this message]
2005-03-10 14:33 ` Zwane Mwaikambo
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=m1mztbvq7p.fsf@muc.de \
--to=ak@muc.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zwane@arm.linux.org.uk \
/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