Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Liang Jie and committed by
Tejun Heo
e197f5ec 8da7bf2c

+1 -1
+1 -1
kernel/sched/ext.c
··· 960 960 static struct scx_dispatch_q **global_dsqs; 961 961 962 962 static const struct rhashtable_params dsq_hash_params = { 963 - .key_len = 8, 963 + .key_len = sizeof_field(struct scx_dispatch_q, id), 964 964 .key_offset = offsetof(struct scx_dispatch_q, id), 965 965 .head_offset = offsetof(struct scx_dispatch_q, hash_node), 966 966 };