[RFC] new MSR r/w functions per CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dave Jones wrote:
> 
> Exposing the guts of the msr driver like that doesn't seem too clean.
> For in-kernel use, why not just add something like this..
> (note:not even compile tested)..
> 

Well, that *is* the guts of the MSR driver.

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

	-hpa




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux