From: Chen Yu <yu.c.chen@intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Cc: Phil Auld <pauld@redhat.com>,
Biju Das <biju.das.jz@bp.renesas.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
linux-kernel@vger.kernel.org, Tim Chen <tim.c.chen@intel.com>,
Chen Yu <yu.chen.surf@gmail.com>, Chen Yu <yu.c.chen@intel.com>
Subject: [PATCH] sched/fair: Use printk_deferred instead of printk in pick_eevdf()
Date: Tue, 10 Oct 2023 11:25:41 +0800 [thread overview]
Message-ID: <20231010032541.339606-1-yu.c.chen@intel.com> (raw)
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
next reply other threads:[~2023-10-10 3:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 3:25 Chen Yu [this message]
2023-10-10 7:59 ` [PATCH] sched/fair: Use printk_deferred instead of printk in pick_eevdf() Peter Zijlstra
2023-10-10 12:26 ` Phil Auld
2023-10-10 14:12 ` Peter Zijlstra
2023-10-11 10:27 ` Chen Yu
2023-10-11 10:30 ` Chen Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231010032541.339606-1-yu.c.chen@intel.com \
--to=yu.c.chen@intel.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mingo@redhat.com \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=tim.c.chen@intel.com \
--cc=vincent.guittot@linaro.org \
--cc=yu.chen.surf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox