Prompted by my experiments with extreme number of threads, which show that the 
number of ITLB misses increases proportionally with the number of threads (even 
though all threads execute the same code), I dug into the kernel code.

Full-text search for CR3 loads reveals hat_switch() in 
onnv-gate/usr/src/uts/i86pc/vm/hat_i86.c
which is used by resume() in onnv-gate/usr/src/uts/intel/ia32/ml/swtch.s

The comment at the top of swtch.s states "The MMU context changes when the 
resuming thread resides in a different process. Kernel threads are known by 
resume to reside in process 0. The MMU context, therefore, only changes when 
resuming a thread in a process different from curproc."

However, the present code does not seem to check whether the switched-in thread 
belongs to a different process; instead CR3 is loaded unconditionally. This is 
consistent with # of ITLB misses being proportional to # of threads.

Did I overlook some other place where this check could potentially be performed?
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to