mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Rate-limit scheduling of work-events
In general, events are code handling some some condition, which is scheduled when such condition happened and executed independently from I/O loop. Work-events are a subgroup of events that are scheduled repeatedly until some (often significant) work is done (e.g. feeding routes to protocol). All scheduled events are executed during each I/O loop iteration. Separate work-events from regular events to a separate queue and rate limit their execution to a fixed number per I/O loop iteration. That should prevent excess latency when many work-events are scheduled at one time (e.g. simultaneous reload of many BGP sessions).
This commit is contained in:
10
nest/proto.c
10
nest/proto.c
@@ -252,7 +252,7 @@ channel_schedule_feed(struct channel *c, int initial)
|
||||
c->export_state = ES_FEEDING;
|
||||
c->refeeding = !initial;
|
||||
|
||||
ev_schedule(c->feed_event);
|
||||
ev_schedule_work(c->feed_event);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -275,7 +275,7 @@ channel_feed_loop(void *ptr)
|
||||
// DBG("Feeding protocol %s continued\n", p->name);
|
||||
if (!rt_feed_channel(c))
|
||||
{
|
||||
ev_schedule(c->feed_event);
|
||||
ev_schedule_work(c->feed_event);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ channel_feed_loop(void *ptr)
|
||||
|
||||
/* Continue in feed - it will process routing table again from beginning */
|
||||
c->refeed_count = 0;
|
||||
ev_schedule(c->feed_event);
|
||||
ev_schedule_work(c->feed_event);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ channel_schedule_reload(struct channel *c)
|
||||
ASSERT(c->channel_state == CS_UP);
|
||||
|
||||
rt_reload_channel_abort(c);
|
||||
ev_schedule(c->reload_event);
|
||||
ev_schedule_work(c->reload_event);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -485,7 +485,7 @@ channel_reload_loop(void *ptr)
|
||||
|
||||
if (!rt_reload_channel(c))
|
||||
{
|
||||
ev_schedule(c->reload_event);
|
||||
ev_schedule_work(c->reload_event);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user