DragonFly commits List (threaded) for 2007-06
Re: cvs commit: src/sys/dev/sound/pci/hda hdac.c
Matthew Dillon wrote:
> I looked at the code more closely. The callout code is all
> cpu-localized but it isn't 100% SMP safe. It has SMP code to
> handle cross-cpu removal but the CALLOUT_PENDING check is just
> not safe.
> It is a very small window never likely to occur during a detach, but
> I think I need to move up the globaldata pointer test. What do you
> think about this?
When would this happen? Do you think of this:
1. callout starts running, clears CALLOUT_PENDING
2. other cpu runs callout_stop(), tests for CALLOUT_PENDING
3. callout_stop() is happy, returns
4. callout runs callout_reset, enables callouts again
so my question here is: why don't we check for CALLOUT_ACTIVE in the first place? If the callout is not ACTIVE, there is no way that it can fire.
Your change looks good, but what's this CALLOUT_ACTIVE business anyways? I'd use it to signal "callout running right now". Or is it just something like !callout_stopped()?