lib/event: do not set default scheduling period during init
reactor_run() decides whether to start gather_metrics based on non-zero scheduler period. The default of 1 sec was set during initialization, in scheduler_subsystem_init(). This resulted in unessecary operations each second, even if only 'static' scheduler is used. This patch moves setting default scheduling period to respective schedulers. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I953aee271a959b6314c8e83434c922dba9638de4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9492 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
parent
84fa73eb5c
commit
f7e1f48a79
@ -15,6 +15,9 @@
|
||||
static int
|
||||
init_static(void)
|
||||
{
|
||||
/* There is no scheduling perfomed by static scheduler,
|
||||
* do not set the scheduling period. */
|
||||
spdk_scheduler_set_period(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,6 @@ scheduler_subsystem_init(void)
|
||||
if (spdk_scheduler_get() == NULL) {
|
||||
rc = spdk_scheduler_set("static");
|
||||
}
|
||||
if (spdk_scheduler_get_period() == 0) {
|
||||
spdk_scheduler_set_period(SPDK_SEC_TO_USEC);
|
||||
}
|
||||
|
||||
spdk_subsystem_init_next(rc);
|
||||
}
|
||||
|
@ -244,6 +244,11 @@ init(void)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (spdk_scheduler_get_period() == 0) {
|
||||
/* set default scheduling period to one second */
|
||||
spdk_scheduler_set_period(SPDK_SEC_TO_USEC);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user