md_spinlock_count?

Julian Elischer julian at elischer.org
Thu Apr 17 00:12:04 UTC 2008


Murty, Ravi wrote:
> 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? 

Which version/branch?
(and a filename and linenumber would be good too)
You might make it easy for us to answer you :-)

> 
>  
> 
> Thanks
> 
> Ravi Murty
> 
>  
> 
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"



More information about the freebsd-hackers mailing list