Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 May 2000 22:01:18 -0600
From:      Chuck Paterson <cp@bsdi.com>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Terry Lambert <tlambert@primenet.com>, arch@freebsd.org
Subject:   Re: Preemptive kernel on older X86 hardware 
Message-ID:  <200005250401.WAA17540@berserker.bsdi.com>

next in thread | raw e-mail | index | archive | help

}    Function call overhead is around 17 nS (On a PIII 450) in
}    the cache case.
}
}    A locked instruction of any sort, non-contending, eats
}    73 nS.

This means that you use 17ns and on a UP machine with and non locked
cmpxchg the time is going to propably more than double. I
still content that this is the single most important thing
to make fast in the uncontended case and everybit counts.

Actually this can be decided by experimentation when the
thing is running. It's not like a fundamental design decision.

}    A locked instruction with the second cpu doing a contending locked
}    instruction costs 322 nS on EACH cpu.   <<<<<<<<<<<<< VERY EXPENSIVE

With a non spin mutex 322ns just doesn't matter because when this happens
we are going to do a context switch.


}    The non-locked unlock operation eats one clock cycle (less then 10 nS),
}    so being able to use this for unlocking will double the best-case
}    performance of an SMP lock in the non-contending case, and triple it
}    (or even better) in the contending case.

If we have contention on a unlock then once again speed doesn't
matter much we are going to being mucking about putting
something on the run queueu. If the task we put on the run
queue is high priority then we will be switching to it. 

Chuck



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005250401.WAA17540>