summaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorLiang Jie <liangjie@lixiang.com>2024-12-13 17:52:54 +0800
committerTejun Heo <tj@kernel.org>2024-12-13 06:51:19 -1000
commite197f5ec3ad38ad0a014ed1ba672497bdf0550bb (patch)
tree3fb9412a7740e8e766fb4a0160e96c014c89ecac /kernel/sched
parent8da7bf2cee2735dbd2478cf07672ff0d243ce6ed (diff)
downloadlinux-stable-e197f5ec3ad38ad0a014ed1ba672497bdf0550bb.tar.gz
linux-stable-e197f5ec3ad38ad0a014ed1ba672497bdf0550bb.tar.bz2
linux-stable-e197f5ec3ad38ad0a014ed1ba672497bdf0550bb.zip
sched_ext: Use sizeof_field for key_len in dsq_hash_params
Update the `dsq_hash_params` initialization to use `sizeof_field` for the `key_len` field instead of a hardcoded value. This improves code readability and ensures the key length dynamically matches the size of the `id` field in the `scx_dispatch_q` structure. Signed-off-by: Liang Jie <liangjie@lixiang.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/ext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 71342f3719c1..54e659ba9476 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -960,7 +960,7 @@ static DEFINE_PER_CPU(struct task_struct *, direct_dispatch_task);
static struct scx_dispatch_q **global_dsqs;
static const struct rhashtable_params dsq_hash_params = {
- .key_len = 8,
+ .key_len = sizeof_field(struct scx_dispatch_q, id),
.key_offset = offsetof(struct scx_dispatch_q, id),
.head_offset = offsetof(struct scx_dispatch_q, hash_node),
};