[Cbe-oss-dev] [RFC/PATCH]: User-space access to Cell bookmark registers

Arnd Bergmann arnd at arndb.de
Thu Aug 9 07:36:10 EST 2007


On Wednesday 08 August 2007, Kevin Corry wrote:

> Actually, smp_call_function_single() and smp_call_function_map() only seem to 
> work if you're trying to run the routine on a different CPU than the one 
> you're currently executing on. So we'd have to add checks to see which CPU 
> we're running on and either call smp_call_function_single() or call the 
> desired routine directly.

No, smp_call_function_single() already contains the code to work around
the limitation of smp_call_function_map().
 
> I don't know if this register is available on the ps3 or celleb platforms, so 
> I'll use the platform_is(cell) approach for now (actually, it looks like the 
> macro is called "machine_is()"). Do you know if there's documentation 
> available for the ps3 and/or celleb that would have that information?

I'd say you have to try it. Of course, since the pmu code checks for
"machine_is(cell)" already, it makes sense to have an identical check here
as well.

Maybe it should even be called from the same initcall. You'll have to
convert it from an arch_initcall() to a device_initcall in order
to create the sysfs files, but I think that's the right approach
anyway.

> +static SYSDEV_ATTR(pmu_bookmark, 0200, NULL, cbe_store_pmu_bookmark);

One more thing here: For consistency, we might want to cache the last
value that was written to the file and make it readable, if that makes
any sense for the data you write to it.

Is the value per core or per SMT thread? If the former, that would cause
extra effort to keep the cached value consistent over both threads, which
is probably not worth it.

	Arnd <><



More information about the cbe-oss-dev mailing list