From: liulongfang liulongfang@huawei.com
In the current acquisition method, if there is no scheduling domain of the specified mode and operation type in the specified numa domain, it will search the scheduling domains in each numa, and find a valid scheduling domain for use.
However, the operation mode will not be strictly matched during the query, which will lead to the use of the compressed type queue in the decompression type task, that will eventually lead to task data errors.
Therefore, this operation type also needs to be strictly matched. If it doesn't match, you need to report an error.
Signed-off-by: liulongfang liulongfang@huawei.com --- wd_sched.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/wd_sched.c b/wd_sched.c index cbd7a9b..bb5264e 100644 --- a/wd_sched.c +++ b/wd_sched.c @@ -103,7 +103,6 @@ static struct sched_ctx_region *sched_get_ctx_range(struct wd_sched_ctx *sched_c { struct wd_sched_info *sched_info; int numa_id; - int type;
sched_info = sched_ctx->sched_info; if (key->numa_id >= 0 && @@ -112,10 +111,8 @@ static struct sched_ctx_region *sched_get_ctx_range(struct wd_sched_ctx *sched_c
/* If the key->numa_id is not exist, we should scan for a region */ for (numa_id = 0; numa_id < sched_ctx->numa_num; numa_id++) { - for (type = 0; type < sched_ctx->type_num; type++) { - if (sched_info[numa_id].ctx_region[key->mode][type].valid) - return &sched_info[numa_id].ctx_region[key->mode][type]; - } + if (sched_info[numa_id].ctx_region[key->mode][key->type].valid) + return &sched_info[numa_id].ctx_region[key->mode][key->type]; }
return NULL;