From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: a.darwish@linutronix.de, bigeasy@linutronix.de,
dan.carpenter@oracle.com, davem@davemloft.net, lkp@intel.com,
stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] net: core: device_rename: Use rwsem instead of a seqcount" failed to apply to 5.4-stable tree
Date: Tue, 23 Jun 2020 09:58:10 -0400 [thread overview]
Message-ID: <20200623135810.GA1931@sasha-vm> (raw)
In-Reply-To: <159291361435200@kroah.com>
On Tue, Jun 23, 2020 at 02:00:14PM +0200, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 5.4-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 11d6011c2cf29f7c8181ebde6c8bc0c4d83adcd7 Mon Sep 17 00:00:00 2001
>From: "Ahmed S. Darwish" <a.darwish@linutronix.de>
>Date: Wed, 3 Jun 2020 16:49:44 +0200
>Subject: [PATCH] net: core: device_rename: Use rwsem instead of a seqcount
>
>Sequence counters write paths are critical sections that must never be
>preempted, and blocking, even for CONFIG_PREEMPTION=n, is not allowed.
>
>Commit 5dbe7c178d3f ("net: fix kernel deadlock with interface rename and
>netdev name retrieval.") handled a deadlock, observed with
>CONFIG_PREEMPTION=n, where the devnet_rename seqcount read side was
>infinitely spinning: it got scheduled after the seqcount write side
>blocked inside its own critical section.
>
>To fix that deadlock, among other issues, the commit added a
>cond_resched() inside the read side section. While this will get the
>non-preemptible kernel eventually unstuck, the seqcount reader is fully
>exhausting its slice just spinning -- until TIF_NEED_RESCHED is set.
>
>The fix is also still broken: if the seqcount reader belongs to a
>real-time scheduling policy, it can spin forever and the kernel will
>livelock.
>
>Disabling preemption over the seqcount write side critical section will
>not work: inside it are a number of GFP_KERNEL allocations and mutex
>locking through the drivers/base/ :: device_rename() call chain.
>
>>From all the above, replace the seqcount with a rwsem.
>
>Fixes: 5dbe7c178d3f (net: fix kernel deadlock with interface rename and netdev name retrieval.)
>Fixes: 30e6c9fa93cf (net: devnet_rename_seq should be a seqcount)
>Fixes: c91f6df2db49 (sockopt: Change getsockopt() of SO_BINDTODEVICE to return an interface name)
>Cc: <stable@vger.kernel.org>
>Reported-by: kbuild test robot <lkp@intel.com> [ v1 missing up_read() on error exit ]
>Reported-by: Dan Carpenter <dan.carpenter@oracle.com> [ v1 missing up_read() on error exit ]
>Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
>Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>Signed-off-by: David S. Miller <davem@davemloft.net>
The conflict was due to a change in comments in commit 2da2b32fd934
("sched/rt, net: Use CONFIG_PREEMPTION.patch"). I've just grabbed
2da2b32fd934 along and queued both of these for 5.4-4.4.
--
Thanks,
Sasha
prev parent reply other threads:[~2020-06-23 13:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 12:00 FAILED: patch "[PATCH] net: core: device_rename: Use rwsem instead of a seqcount" failed to apply to 5.4-stable tree gregkh
2020-06-23 13:58 ` Sasha Levin [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=20200623135810.GA1931@sasha-vm \
--to=sashal@kernel.org \
--cc=a.darwish@linutronix.de \
--cc=bigeasy@linutronix.de \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=lkp@intel.com \
--cc=stable@vger.kernel.org \
/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