From: David Miller <davem@davemloft.net>
To: bigeasy@linutronix.de
Cc: sergei.shtylyov@cogentembedded.com, netdev@vger.kernel.org,
jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
edumazet@google.com, tglx@linutronix.de, mkl@pengutronix.de,
peterz@infradead.org
Subject: Re: [PATCH net-next v2] net: sched: Avoid using yield() in a busy waiting loop
Date: Thu, 17 Oct 2019 15:33:40 -0400 (EDT) [thread overview]
Message-ID: <20191017.153340.1998610553660604312.davem@davemloft.net> (raw)
In-Reply-To: <20191016082833.u4jxbiqg3oo6lyue@linutronix.de>
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 16 Oct 2019 10:28:33 +0200
> From: Marc Kleine-Budde <mkl@pengutronix.de>
>
> With threaded interrupts enabled, the interrupt thread runs as SCHED_RR
> with priority 50. If a user application with a higher priority preempts
> the interrupt thread and tries to shutdown the network interface then it
> will loop forever. The kernel will spin in the loop waiting for the
> device to become idle and the scheduler will never consider the
> interrupt thread because its priority is lower.
>
> Avoid the problem by sleeping for a jiffy giving other tasks,
> including the interrupt thread, a chance to run and make progress.
>
> In the original thread it has been suggested to use wait_event() and
> properly waiting for the state to occur. DaveM explained that this would
> require to add expensive checks in the fast paths of packet processing.
>
> Link: https://lkml.kernel.org/r/1393976987-23555-1-git-send-email-mkl@pengutronix.de
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> [bigeasy: Rewrite commit message, add comment, use
> schedule_timeout_uninterruptible()]
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> v1…v2: Typo fixes, noticed by Sergei Shtylyov.
Applied, thank you.
prev parent reply other threads:[~2019-10-17 19:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 17:15 [PATCH net-next] net: sched: Avoid using yield() in a busy waiting loop Sebastian Andrzej Siewior
2019-10-12 19:14 ` Sergei Shtylyov
2019-10-16 8:28 ` [PATCH net-next v2] " Sebastian Andrzej Siewior
2019-10-16 17:28 ` Cong Wang
2019-10-16 18:48 ` Sebastian Andrzej Siewior
2019-10-16 21:33 ` Cong Wang
2019-10-17 19:33 ` David Miller [this message]
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=20191017.153340.1998610553660604312.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bigeasy@linutronix.de \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=tglx@linutronix.de \
--cc=xiyou.wangcong@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;
as well as URLs for NNTP newsgroup(s).