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: Wrap deferred_reenq_local_node into a struct

Wrap the deferred_reenq_local_node list_head into struct
scx_deferred_reenq_local. More fields will be added and this allows using a
shorthand pointer to access them.

No functional change.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>

Tejun Heo 0c4df54a 8c1b9453

+18 -10
+13 -9
kernel/sched/ext.c
··· 3647 3647 struct scx_sched *sch; 3648 3648 3649 3649 scoped_guard (raw_spinlock, &rq->scx.deferred_reenq_lock) { 3650 - struct scx_sched_pcpu *sch_pcpu = 3650 + struct scx_deferred_reenq_local *drl = 3651 3651 list_first_entry_or_null(&rq->scx.deferred_reenq_locals, 3652 - struct scx_sched_pcpu, 3653 - deferred_reenq_local_node); 3654 - if (!sch_pcpu) 3652 + struct scx_deferred_reenq_local, 3653 + node); 3654 + struct scx_sched_pcpu *sch_pcpu; 3655 + 3656 + if (!drl) 3655 3657 return; 3656 3658 3659 + sch_pcpu = container_of(drl, struct scx_sched_pcpu, 3660 + deferred_reenq_local); 3657 3661 sch = sch_pcpu->sch; 3658 - list_del_init(&sch_pcpu->deferred_reenq_local_node); 3662 + list_del_init(&drl->node); 3659 3663 } 3660 3664 3661 3665 reenq_local(sch, rq); ··· 4203 4199 for_each_possible_cpu(cpu) { 4204 4200 struct scx_sched_pcpu *pcpu = per_cpu_ptr(sch->pcpu, cpu); 4205 4201 4206 - WARN_ON_ONCE(!list_empty(&pcpu->deferred_reenq_local_node)); 4202 + WARN_ON_ONCE(!list_empty(&pcpu->deferred_reenq_local.node)); 4207 4203 } 4208 4204 4209 4205 free_percpu(sch->pcpu); ··· 5816 5812 struct scx_sched_pcpu *pcpu = per_cpu_ptr(sch->pcpu, cpu); 5817 5813 5818 5814 pcpu->sch = sch; 5819 - INIT_LIST_HEAD(&pcpu->deferred_reenq_local_node); 5815 + INIT_LIST_HEAD(&pcpu->deferred_reenq_local.node); 5820 5816 } 5821 5817 5822 5818 sch->helper = kthread_run_worker(0, "sched_ext_helper"); ··· 8394 8390 scoped_guard (raw_spinlock, &rq->scx.deferred_reenq_lock) { 8395 8391 struct scx_sched_pcpu *pcpu = this_cpu_ptr(sch->pcpu); 8396 8392 8397 - if (list_empty(&pcpu->deferred_reenq_local_node)) 8398 - list_move_tail(&pcpu->deferred_reenq_local_node, 8393 + if (list_empty(&pcpu->deferred_reenq_local.node)) 8394 + list_move_tail(&pcpu->deferred_reenq_local.node, 8399 8395 &rq->scx.deferred_reenq_locals); 8400 8396 } 8401 8397
+5 -1
kernel/sched/ext_internal.h
··· 954 954 struct scx_dsp_buf_ent buf[]; 955 955 }; 956 956 957 + struct scx_deferred_reenq_local { 958 + struct list_head node; 959 + }; 960 + 957 961 struct scx_sched_pcpu { 958 962 struct scx_sched *sch; 959 963 u64 flags; /* protected by rq lock */ ··· 969 965 */ 970 966 struct scx_event_stats event_stats; 971 967 972 - struct list_head deferred_reenq_local_node; 968 + struct scx_deferred_reenq_local deferred_reenq_local; 973 969 struct scx_dispatch_q bypass_dsq; 974 970 #ifdef CONFIG_EXT_SUB_SCHED 975 971 u32 bypass_host_seq;