kernel threads and mplock

Hiten Pandya hmp at backplane.com
Mon Jul 12 06:03:22 PDT 2004


Hidetoshi Shimokawa wrote:
Hi,

I have a question about kernel threads synchronization on DFB.
A comment in lwkt_thread.c says:
 * NOTE!  By default new threads are created with the MP lock held.  A
 * thread which does not require the MP lock should release it by calling
 * rel_mplock() at the start of the new thread.
 */
Where can I find an example for thread running without MP lock?
	The LWKT scheduler and the systimer code runs without the MP
	lock.
	If you want an example of how and where it is released, then
	checkout, i386/i386/vm/vm_machdep.c, kern/init_main.c, also
	kern/kern_clock.c, kern/kern_switch.c, kern/kern_synch.c and
	last but not the least, i386/i386/trap.c.
I heard that TCP protocol stack has multiple kernel threads.
Do they actually run concurrently on multiple cpu now?
I can't find where they release MP lock.
	There are still a few bits which need to be finished before the
	network is actually free of the MP lock.
It seems that most of the kernel threads are running with MP lock
now. Right?
	Right.  This will change, though.

/\ Hidetoshi Shimokawa
\/  simokawa at xxxxxxxxxxxxxxxxxxx
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html
		-Hiten
		hmp at xxxxxxxxxxxxx




More information about the Kernel mailing list