dsq->first_task is __rcu for the lockless scx_bpf_dsq_peek(). The task removal path compares it against the departing task with a plain load, which sparse flags. The comparison runs under the dsq lock and only tests identity, so rcu_access_pointer() is the fit.
Unified · Split
| @@ -1654,7 +1654,7 @@ static void task_unlink_from_dsq(struct task_struct *p, · 1653 unmodified lines | ||
| 1654 | 1654 | list_del_init(&p->scx.dsq_list.node); |
| 1655 | 1655 | dsq_dec_nr(dsq, p); |
| 1656 | 1656 | |
| 1657 | − if (!(dsq->id & SCX_DSQ_FLAG_BUILTIN) && dsq->first_task == p) { | |
| 1657 | + if (!(dsq->id & SCX_DSQ_FLAG_BUILTIN) && rcu_access_pointer(dsq->first_task) == p) { | |
| 1658 | 1658 | struct task_struct *first_task; |
| 1659 | 1659 | |
| 1660 | 1660 | first_task = nldsq_next_task(dsq, NULL, false); |