Messages in this thread Patch in this message | | | From | Chen Yu <> | Subject | [PATCH] sched/fair: Use printk_deferred instead of printk in pick_eevdf() | Date | Tue, 10 Oct 2023 11:25:41 +0800 |
| |
When no eligible entity is found in pick_eevdf(), it has to pick the entity with smallest vruntime. This indicates a potential issue and scheduler will print this error.
However this printk could introduce possible circular locking issue because when the code path reaches here with the rq lock held, the printk could trigger further scheduling which loops back to the scheduler.
Use printk_deferred() to defer the console write from current context to the irq work in the next tick.
Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy") Suggested-by: Phil Auld <pauld@redhat.com> Reported-by: Biju Das <biju.das.jz@bp.renesas.com> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Chen Yu <yu.c.chen@intel.com> --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 061a30a8925a..70f38e54b6ce 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -973,7 +973,7 @@ static struct sched_entity *pick_eevdf(struct cfs_rq *cfs_rq) if (!se) { struct sched_entity *left = __pick_first_entity(cfs_rq); if (left) { - pr_err("EEVDF scheduling fail, picking leftmost\n"); + printk_deferred(KERN_ERR "EEVDF scheduling fail, picking leftmost\n"); return left; } } -- 2.25.1
| |