Bug #1002
closedadaptive serialize enter
0%
Description
Hi,
Following patch adds adaptive serialize enter support for SMP. It
spins a little bit before calling tsleep. I have used it on ifq in a
local patch with very good results. In the current setting, it favors
spinning more than sleeping. debug.serialize_boround and
debug.serialize_bolimit could be used to change what it favors. When
the contention is too heavy, it is much better than pure spinlock;
system will not be choked for ~1seconds under extreme condition by
chance (it is really very rare after randomizing spinlock backoff,
but it does happen)
Please review it:
http://leaf.dragonflybsd.org/~sephe/lwkt_serialize.c.diff
Best Regards,
sephe
Updated by corecode over 16 years ago
Are you allowed to call tsleep_interlock() without doing a tsleep afterwards?
cheers
simon
Updated by sepherosa over 16 years ago
On Sun, May 4, 2008 at 7:12 PM, Simon 'corecode' Schubert
<corecode@fs.ei.tum.de> wrote:
Sepherosa Ziehau wrote:
+ crit_enter();
+ tsleep_interlock(s);
+ if (atomic_intr_cond_test(&s->interlock) != 0) {
#ifdef PROFILE_SERIALIZER
s->sleep_cnt++;
#endif
logslz(sleep_beg, s);
+ tsleep(s, 0, "slize", 0);
+ logslz(sleep_end, s);
+ }
+ crit_exit();Are you allowed to call tsleep_interlock() without doing a tsleep
afterwards?
It is allowed. Exact wakeup does not depend on it. It may only
generate extra ipi traffic, afaik.
Best Regards,
sephe