From: Dave Jones <davej@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Rudolf Marek <r.marek@assembler.cz>,
norsk5@xmission.com, lkml <linux-kernel@vger.kernel.org>,
LM Sensors <lm-sensors@lm-sensors.org>,
bluesmoke-devel@lists.sourceforge.net
Subject: Re: [RFC] new MSR r/w functions per CPU
Date: Wed, 13 Dec 2006 17:26:16 -0500 [thread overview]
Message-ID: <20061213222616.GJ2418@redhat.com> (raw)
In-Reply-To: <45807C88.6060807@zytor.com>
On Wed, Dec 13, 2006 at 02:19:52PM -0800, H. Peter Anvin wrote:
> > void rdmsr_on_cpu(unsigned int cpu, unsigned long msr, unsigned long *lo, unsigned long *hi)
> > {
> > cpumask_t oldmask;
> >
> > oldmask = current->cpus_allowed;
> > set_cpus_allowed(current, cpumask_of_cpu(cpu));
> >
> > rdmsr(msr, &lo, &hi);
> >
> > set_cpus_allowed(current, oldmask);
> > }
> >
>
> [The above doesn't work, by the way. This approach was discussed a long
> time ago, and vetoed due to the potential for deadlock.]
Can you explain this a little further? I'm fairly certain
there are places in the kernel already doing this (or similar).
In fact, I cut-n-pasted most of the above from similar code in the
powernow-k8 driver. What exactly can we deadlock on?
Dave
--
http://www.codemonkey.org.uk
next prev parent reply other threads:[~2006-12-13 22:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-13 21:45 Rudolf Marek
2006-12-13 22:01 ` H. Peter Anvin
2006-12-13 22:10 ` Dave Jones
2006-12-13 22:19 ` H. Peter Anvin
2006-12-13 22:26 ` Dave Jones [this message]
2006-12-13 22:45 ` H. Peter Anvin
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=20061213222616.GJ2418@redhat.com \
--to=davej@redhat.com \
--cc=bluesmoke-devel@lists.sourceforge.net \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=norsk5@xmission.com \
--cc=r.marek@assembler.cz \
/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
Powered by JetHome