diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e041a8c..e6e051ef7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## v23.01: (Upcoming Release) +### scheduler + +Changing scheduler from dynamic back to static is no longer possible, +as there is no way of saving original SPDK thread distribution on reactors. + ## v22.09 ### accel diff --git a/lib/event/app_rpc.c b/lib/event/app_rpc.c index a43b50786..a6c1e22fd 100644 --- a/lib/event/app_rpc.c +++ b/lib/event/app_rpc.c @@ -465,6 +465,17 @@ rpc_framework_set_scheduler(struct spdk_jsonrpc_request *request, goto end; } + scheduler = spdk_scheduler_get(); + /* SPDK does not support changing scheduler back to static. */ + if (scheduler != NULL && (strcmp(req.name, "static") == 0) && + strcmp(scheduler->name, "static") != 0) { + spdk_jsonrpc_send_error_response(request, + SPDK_JSONRPC_ERROR_INVALID_PARAMS, + "Static scheduler cannot be re-enabled " + "after a different scheduler was selected"); + goto end; + } + if (req.period != 0) { spdk_scheduler_set_period(req.period); } @@ -476,7 +487,6 @@ rpc_framework_set_scheduler(struct spdk_jsonrpc_request *request, goto end; } - scheduler = spdk_scheduler_get(); if (scheduler != NULL && scheduler->set_opts != NULL) { ret = scheduler->set_opts(params); }