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>
54 lines
977 B
C
54 lines
977 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright (c) Intel Corporation.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#include "spdk/stdinc.h"
|
|
#include "spdk/likely.h"
|
|
#include "spdk/event.h"
|
|
#include "spdk/log.h"
|
|
#include "spdk/env.h"
|
|
#include "spdk/scheduler.h"
|
|
|
|
#include "spdk_internal/event.h"
|
|
|
|
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;
|
|
}
|
|
|
|
static void
|
|
deinit_static(void)
|
|
{
|
|
}
|
|
|
|
static void
|
|
balance_static(struct spdk_scheduler_core_info *cores, uint32_t core_count)
|
|
{
|
|
}
|
|
|
|
static int
|
|
set_opts_static(const struct spdk_json_val *opts)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static void
|
|
get_opts_static(struct spdk_json_write_ctx *ctx)
|
|
{
|
|
}
|
|
|
|
static struct spdk_scheduler scheduler = {
|
|
.name = "static",
|
|
.init = init_static,
|
|
.deinit = deinit_static,
|
|
.balance = balance_static,
|
|
.set_opts = set_opts_static,
|
|
.get_opts = get_opts_static,
|
|
};
|
|
SPDK_SCHEDULER_REGISTER(scheduler);
|