sys/ia64/include/pcpu.h patch proposal

Marcel Moolenaar xcllnt at mac.com
Thu Nov 20 08:55:51 PST 2008


On Nov 20, 2008, at 12:43 AM, Marc Lörner wrote:

> Hello,
> attached is a patch of pcpu.h against current to make access of
> pcpu-structures preemption-ready (like in amd64).

I thought that only curthread() is critical. All other
PCPU accesses are sufficiently protected by context.
Is that not the case?

In other words, wouldn't it be enough to declare pcpup
as volatile?

Besides that: yes there's an atomicity problem getting
to the PCPU. I'm not sure your patch fixes that because
a thread can move to another CPU after obtaining the
address of some field in the PCPU and before reading
from that address. Unless all accesses are protected
by context, in which case there's no problem now I
think...

-- 
Marcel Moolenaar
xcllnt at mac.com





More information about the freebsd-ia64 mailing list