On Mon, Nov 26, 2007 at 08:29:44PM -0800, Neelam wrote: > * Voluntary context switches occur almost every time due to doorfs() > system call. They do occur for a few times due to lwp_park() and very > few times due to yield().
door_call() does a context switch, yes (an optimized one, but one nonetheless). Solaris uses lots of doors for lots of things... Few apps call yield(). > * Involuntary happens anytime. (lwp_park(), read(), fstat(), putmsg(), > gtime() and sometime without any system call!!) > > Does anyone have any idea, what could be the reason for this unexpected > behavior? Yes: the kernel is fully preemtible. Non-fully-preemtible kernels only do involuntary context switches at very well defined boundaries: when the process is running in user-land, when the process returns from a system call, ... But Solaris' is a fully preemtible kernel and there's only a few points where preemption is not possible, which means that involuntary context switches can happen in surprising places -- surprising if you are used to old Unix kernel designs. Nico -- _______________________________________________ dtrace-discuss mailing list dtrace-discuss@opensolaris.org