Commit a42bc1d2 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

event: enforce 1 second default scheduling period



Currently the scheduling period was an optional parameter for
the framework_set_scheduler RPC. The 'dynamic' scheduler
enforced its own default by explicitly setting the period
to 1 second during init, if no value had been specified.

But other schedulers (gscheduler) didn't have that same code.
We could add it, but it's better to just enforce this when
the scheduler is first set - if user didn't pass a period,
set it to 1s.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: Ie2e1b3326438b34ebe0f3f65bf568e16621a288b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22593


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9b562bdf
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -478,6 +478,11 @@ rpc_framework_set_scheduler(struct spdk_jsonrpc_request *request,

	if (req.period != 0) {
		spdk_scheduler_set_period(req.period);
	} else if (spdk_scheduler_get_period() == 0) {
		/* User didn't specify a period, and no period has been set
		 * previously, so set it now to 1 second.
		 */
		spdk_scheduler_set_period(SPDK_SEC_TO_USEC);
	}

	ret = spdk_scheduler_set(req.name);
+0 −5
Original line number Diff line number Diff line
@@ -244,11 +244,6 @@ 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;
}