Commit e719e17
committed
sched_ext: Warn on task-based SCX op recursion
The kf_tasks[] design assumes task-based SCX ops don't nest - if they
did, kf_tasks[0] would get clobbered. The old scx_kf_allow() WARN_ONCE
caught invalid nesting via kf_mask, but that machinery is gone now.
Add a WARN_ON_ONCE(current->scx.kf_tasks[0]) at the top of each
SCX_CALL_OP_TASK*() macro. Checking kf_tasks[0] alone is sufficient: all
three variants (SCX_CALL_OP_TASK, SCX_CALL_OP_TASK_RET,
SCX_CALL_OP_2TASKS_RET) write to kf_tasks[0], so a non-NULL value at
entry to any of the three means re-entry from somewhere in the family.
Signed-off-by: Tejun Heo <[email protected]>
Acked-by: Andrea Righi <[email protected]>1 parent 979a98b commit e719e17
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
506 | 508 | | |
507 | 509 | | |
508 | 510 | | |
| 511 | + | |
509 | 512 | | |
510 | 513 | | |
511 | 514 | | |
| |||
514 | 517 | | |
515 | 518 | | |
516 | 519 | | |
| 520 | + | |
517 | 521 | | |
518 | 522 | | |
519 | 523 | | |
| |||
523 | 527 | | |
524 | 528 | | |
525 | 529 | | |
| 530 | + | |
526 | 531 | | |
527 | 532 | | |
528 | 533 | | |
| |||
0 commit comments