From: Christian Hoelbling <christian.holbling@cern.ch>
To: Dominik Brodowski <linux@dominikbrodowski.de>
Cc: cpufreq@www.linux.org.uk
Subject: Re: [PATCH 2.6.8-rc2] speedstep SMT support
Date: Fri, 30 Jul 2004 11:36:34 +0000 [thread overview]
Message-ID: <410A32C2.3080002@cern.ch> (raw)
In-Reply-To: <20040729163450.GA7947@dominikbrodowski.de>
[-- Attachment #1: Type: text/plain, Size: 198 bytes --]
hi,
here is the new patch w.r.t. the latest cpufreq-development snapshot
(thanks for pointing me to it!). it should make speedstep-ich SMP save
(altough that is hypothetical for now).
chris
[-- Attachment #2: speedstep_SMP.diff --]
[-- Type: text/x-patch, Size: 2143 bytes --]
diff --unified --recursive --new-file linux-2.6.8-rc2-cpufreq/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c linux-2.6.8-rc2-cpufreq.my/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
--- linux-2.6.8-rc2-cpufreq/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c 2004-07-26 10:13:07.000000000 +0000
+++ linux-2.6.8-rc2-cpufreq.my/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c 2004-07-30 11:00:59.000000000 +0000
@@ -247,14 +247,14 @@
if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
return -EINVAL;
+ freqs.old = speedstep_get(policy->cpu);
+ freqs.new = speedstep_freqs[newstate].frequency;
+ freqs.cpu = policy->cpu;
+
/* no transition necessary */
if (freqs.old == freqs.new)
return 0;
- freqs.old = speedstep_get_processor_frequency(speedstep_processor);
- freqs.new = speedstep_freqs[newstate].frequency;
- freqs.cpu = policy->cpu;
-
cpus_allowed = current->cpus_allowed;
/* only run on CPU to be set, or on its sibling */
@@ -324,14 +324,13 @@
&speedstep_freqs[SPEEDSTEP_LOW].frequency,
&speedstep_freqs[SPEEDSTEP_HIGH].frequency,
&speedstep_set_state);
+ set_cpus_allowed(current, cpus_allowed);
if (result) {
- set_cpus_allowed(current, cpus_allowed);
return result;
}
/* get current speed setting */
- speed = speedstep_get_processor_frequency(speedstep_processor);
- set_cpus_allowed(current, cpus_allowed);
+ speed = speedstep_get(policy->cpu);
if (!speed)
return -EIO;
@@ -362,7 +361,20 @@
static unsigned int speedstep_get(unsigned int cpu)
{
- return speedstep_get_processor_frequency(speedstep_processor);
+ unsigned int speed;
+ cpumask_t cpus_allowed,affected_cpu_map;
+
+ /* only run on CPU to be set, or on its sibling */
+ cpus_allowed = current->cpus_allowed;
+#ifdef CONFIG_SMP
+ affected_cpu_map = cpu_sibling_map[cpu];
+#else
+ affected_cpu_map = cpumask_of_cpu(cpu);
+#endif
+ set_cpus_allowed(current, affected_cpu_map);
+ speed=speedstep_get_processor_frequency(speedstep_processor);
+ set_cpus_allowed(current, cpus_allowed);
+ return speed;
}
static struct freq_attr* speedstep_attr[] = {
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@www.linux.org.uk
http://www.linux.org.uk/mailman/listinfo/cpufreq
next prev parent reply other threads:[~2004-07-30 11:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-28 14:31 [PATCH 2.6.8-rc2] speedstep SMT support Christian Hoelbling
2004-07-28 17:20 ` Dominik Brodowski
2004-07-29 12:19 ` Christian Hoelbling
2004-07-29 16:34 ` Dominik Brodowski
2004-07-30 11:36 ` Christian Hoelbling [this message]
2004-07-30 15:46 ` Dominik Brodowski
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=410A32C2.3080002@cern.ch \
--to=christian.holbling@cern.ch \
--cc=Christian.Hoelbling@cpt.univ-mrs.fr \
--cc=cpufreq@www.linux.org.uk \
--cc=linux@dominikbrodowski.de \
/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