md_spinlock_count?

Murty, Ravi ravi.murty at intel.com
Wed Apr 16 22:02:38 UTC 2008


Hello All,

 

I was looking at the code that creates a new process (fork) with a
single thread coming out on the other side. I can't figure out a couple
of things.

 

1.	Why is the md_spinlock_count for the new thread set to 1 and not
to 0. This happens in cpu_fork and cpu_set_upcall under the amd64 tree.
2.	If this was the "per-cpu" idle thread and the AP was booting up
(running init_secondary) why does it grab sched_lock and call
spinlock_exit. It would seem simpler to set the count of the idle thread
to 0 and not have to call spinlock_exit. The only answer I can come up
with is the fact that a non-zero spinlock_count prevents interrupts from
getting disabled/renabled to some unknown value?

 

Thanks

Ravi Murty



More information about the freebsd-hackers mailing list