mirror of
https://github.com/torvalds/linux.git
synced 2026-05-21 21:37:25 +02:00
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>
This commit is contained in:
parent
8da7bf2cee
commit
e197f5ec3a
|
|
@ -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),
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user