cvs commit: src/sys/sys systm.h src/sys/kern kern_synch.c
Matthew Dillon
dillon at apollo.backplane.com
Mon Oct 24 15:11:23 PDT 2005
:eirikn 2005/10/24 14:57:55 PDT
:
:DragonFly src repository
:
: Modified files:
: sys/sys systm.h
: sys/kern kern_synch.c
: Log:
: Make wakeup, tsleep and friends MP-safe.
:
: Reviewed by: hsu
:
: Revision Changes Path
: 1.32 +1 -0 src/sys/sys/systm.h
: 1.49 +140 -12 src/sys/kern/kern_synch.c
:
:
:http://www.dragonflybsd.org/cvsweb/src/sys/sys/systm.h.diff?r1=1.31&r2=1.32&f=u
:http://www.dragonflybsd.org/cvsweb/src/sys/kern/kern_synch.c.diff?r1=1.48&r2=1.49&f=u
Urmm.... you can't safely malloc inside tsleep/wakeup, it will break
the atomicy of the tsleep operation. We'll have to redo this. You
also can't safely use the messaging functions... or at least, they
weren't designed to be used in the tsleep/wakeup path.
You can't safely pass a thread pointer with a message... the thread could
very easily go away inbetween the time you sent the message and the time
the other cpu would have otherwise received it.
The only thing that can be safely used is the IPIQ routines, which you
can use to pass the identifier to the other cpu's once you've determined
that they 'might' have work to do.
I would'a told ya that if you had posted it to submit first for review.
I think you need to back this out temporarily, until we can fix all of
these issues. But, I *do* appreciate the attempt!
-Matt
Matthew Dillon
<dillon at xxxxxxxxxxxxx>
More information about the Commits
mailing list