low(er) disk performance with sched_4bsd then with sched_ule

Joseph Koshy joseph.koshy at gmail.com
Thu Sep 15 00:15:56 PDT 2005

ol> I did this now for bs=64k count=32000. The results are here: 
ol> http://pofo.de/tmp/gprof.ule
ol> http://pofo.de/tmp/gprof.4bsd

The top consumer for the 4BSD kernel appears to be is:

 70.8  187656.00 187656.00                             _mtx_lock_sleep [1]

The low rank of the turnstile_* functions in the profile makes me suspect
that the spinning is happening in the following part of the code:


    512                 /*
    513                  * If the current owner of the lock is
executing on another
    514                  * CPU, spin instead of blocking.
    515                  */
    516                 owner = (struct thread *)(v & MTX_FLAGMASK);
    517 #ifdef ADAPTIVE_GIANT
    518                 if (TD_IS_RUNNING(owner)) {
    519 #else
    520                 if (m != &Giant && TD_IS_RUNNING(owner)) {
    521 #endif
    522                         turnstile_release(&m->mtx_object);
    523                         while (mtx_owner(m) == owner &&  \
    524                                 cpu_spinwait();
    525                         }
    526                         continue;

So the next question would be: do you have ADAPTIVE_GIANT turned on
in your kernel config?

What happens if you use a kernel with 'options NO_ADAPTIVE_MUTEXES' ?

[Could you please post your kernel config, and the output of a dmesg after
a boot].

FreeBSD Volunteer,     http://people.freebsd.org/~jkoshy

More information about the freebsd-current mailing list