Project

General

Profile

Actions

Bug #1002

closed

adaptive serialize enter

Added by sepherosa almost 16 years ago. Updated over 15 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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

Actions #1

Updated by corecode almost 16 years ago

Are you allowed to call tsleep_interlock() without doing a tsleep afterwards?

cheers
simon

Actions #2

Updated by sepherosa almost 16 years ago

On Sun, May 4, 2008 at 7:12 PM, Simon 'corecode' Schubert
<> wrote:

Sepherosa Ziehau wrote:

http://leaf.dragonflybsd.org/~sephe/lwkt_serialize.c.diff

+ 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

Actions #3

Updated by sepherosa over 15 years ago

committed

Actions

Also available in: Atom PDF