mbox series

[0/2] kthread_worker: Fix race between kthread_mod_delayed_work()

Message ID 20210630110149.25086-1-pmladek@suse.com
Headers show
Series kthread_worker: Fix race between kthread_mod_delayed_work() | expand

Message

Petr Mladek June 30, 2021, 11:01 a.m. UTC
This is backport of the series for the following stable trees:

   + 4.9
   + 4.14
   + 4.19

The orignal series did not apply because of a conflict with the commit
("kthread: Convert worker lock to raw spinlock").

Petr Mladek (2):
  kthread_worker: split code for canceling the delayed work timer
  kthread: prevent deadlock when kthread_mod_delayed_work() races with
    kthread_cancel_delayed_work_sync()

 kernel/kthread.c | 77 ++++++++++++++++++++++++++++++++----------------
 1 file changed, 51 insertions(+), 26 deletions(-)

Comments

Greg Kroah-Hartman July 5, 2021, 7:10 a.m. UTC | #1
On Wed, Jun 30, 2021 at 01:31:45PM +0200, Petr Mladek wrote:
> On Wed 2021-06-30 13:06:39, Greg KH wrote:

> > On Wed, Jun 30, 2021 at 01:01:47PM +0200, Petr Mladek wrote:

> > > This is backport of the series for the following stable trees:

> > > 

> > >    + 4.9

> > >    + 4.14

> > >    + 4.19

> > > 

> > > The orignal series did not apply because of a conflict with the commit

> > > ("kthread: Convert worker lock to raw spinlock").

> > > 

> > > Petr Mladek (2):

> > >   kthread_worker: split code for canceling the delayed work timer

> > >   kthread: prevent deadlock when kthread_mod_delayed_work() races with

> > >     kthread_cancel_delayed_work_sync()

> > > 

> > >  kernel/kthread.c | 77 ++++++++++++++++++++++++++++++++----------------

> > >  1 file changed, 51 insertions(+), 26 deletions(-)

> > > 

> > > -- 

> > > 2.26.2

> > > 

> > 

> > What is the original git commit ids of these patches in Linus's tree?

> 

> commit 34b3d5344719d14fd2185b2d9459b3abcb8cf9d8 ("kthread_worker: split code for canceling the delayed work timer")

> commit 5fa54346caf67b4b1b10b1f390316ae466da4d53 ("kthread: prevent deadlock when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync())"

> 

> The original commits have already been taken for the newer stable trees.

> 

> I am sorry for the inconvenience.


What about backports for 5.4, 5.10, and 5.12?  We can not take patches
only for older kernels, otherwise people upgrading to newer ones would
have a regression.  Please can you submit these patches for those trees
too?  Until that, I can not take these.

thanks,

greg k-h
Petr Mladek July 7, 2021, 10:55 a.m. UTC | #2
On Mon 2021-07-05 09:10:58, Greg KH wrote:
> On Wed, Jun 30, 2021 at 01:31:45PM +0200, Petr Mladek wrote:

> > On Wed 2021-06-30 13:06:39, Greg KH wrote:

> > > On Wed, Jun 30, 2021 at 01:01:47PM +0200, Petr Mladek wrote:

> > > > This is backport of the series for the following stable trees:

> > > > 

> > > >    + 4.9

> > > >    + 4.14

> > > >    + 4.19

> > > > 

> > > > The orignal series did not apply because of a conflict with the commit

> > > > ("kthread: Convert worker lock to raw spinlock").

> > > > 

> > > > Petr Mladek (2):

> > > >   kthread_worker: split code for canceling the delayed work timer

> > > >   kthread: prevent deadlock when kthread_mod_delayed_work() races with

> > > >     kthread_cancel_delayed_work_sync()

> > > > 

> > > >  kernel/kthread.c | 77 ++++++++++++++++++++++++++++++++----------------

> > > >  1 file changed, 51 insertions(+), 26 deletions(-)

> > > > 

> > > > -- 

> > > > 2.26.2

> > > > 

> > > 

> > > What is the original git commit ids of these patches in Linus's tree?

> > 

> > commit 34b3d5344719d14fd2185b2d9459b3abcb8cf9d8 ("kthread_worker: split code for canceling the delayed work timer")

> > commit 5fa54346caf67b4b1b10b1f390316ae466da4d53 ("kthread: prevent deadlock when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync())"

> > 

> > The original commits have already been taken for the newer stable trees.

> > 

> > I am sorry for the inconvenience.

> 

> What about backports for 5.4, 5.10, and 5.12?  We can not take patches

> only for older kernels, otherwise people upgrading to newer ones would

> have a regression.  Please can you submit these patches for those trees

> too?  Until that, I can not take these.


The patches for 5.4, 5.10, and 5.12 did not need any changes. My
understanding is that the original commits have already been queued
for these never code trees. See the mail in stable-commits:

for 5.4:

https://www.spinics.net/lists/stable-commits/msg203482.html
https://www.spinics.net/lists/stable-commits/msg203481.html

for 5.10:

https://www.spinics.net/lists/stable-commits/msg203486.html
https://www.spinics.net/lists/stable-commits/msg203485.html

for 5.12:

https://www.spinics.net/lists/stable-commits/msg203494.html
https://www.spinics.net/lists/stable-commits/msg203493.html

I am sorry, I should have mentioned this in the cover letter.

Best Regards,
Petr
Greg Kroah-Hartman July 8, 2021, 6:23 p.m. UTC | #3
On Wed, Jul 07, 2021 at 12:55:30PM +0200, Petr Mladek wrote:
> On Mon 2021-07-05 09:10:58, Greg KH wrote:

> > On Wed, Jun 30, 2021 at 01:31:45PM +0200, Petr Mladek wrote:

> > > On Wed 2021-06-30 13:06:39, Greg KH wrote:

> > > > On Wed, Jun 30, 2021 at 01:01:47PM +0200, Petr Mladek wrote:

> > > > > This is backport of the series for the following stable trees:

> > > > > 

> > > > >    + 4.9

> > > > >    + 4.14

> > > > >    + 4.19

> > > > > 

> > > > > The orignal series did not apply because of a conflict with the commit

> > > > > ("kthread: Convert worker lock to raw spinlock").

> > > > > 

> > > > > Petr Mladek (2):

> > > > >   kthread_worker: split code for canceling the delayed work timer

> > > > >   kthread: prevent deadlock when kthread_mod_delayed_work() races with

> > > > >     kthread_cancel_delayed_work_sync()

> > > > > 

> > > > >  kernel/kthread.c | 77 ++++++++++++++++++++++++++++++++----------------

> > > > >  1 file changed, 51 insertions(+), 26 deletions(-)

> > > > > 

> > > > > -- 

> > > > > 2.26.2

> > > > > 

> > > > 

> > > > What is the original git commit ids of these patches in Linus's tree?

> > > 

> > > commit 34b3d5344719d14fd2185b2d9459b3abcb8cf9d8 ("kthread_worker: split code for canceling the delayed work timer")

> > > commit 5fa54346caf67b4b1b10b1f390316ae466da4d53 ("kthread: prevent deadlock when kthread_mod_delayed_work() races with kthread_cancel_delayed_work_sync())"

> > > 

> > > The original commits have already been taken for the newer stable trees.

> > > 

> > > I am sorry for the inconvenience.

> > 

> > What about backports for 5.4, 5.10, and 5.12?  We can not take patches

> > only for older kernels, otherwise people upgrading to newer ones would

> > have a regression.  Please can you submit these patches for those trees

> > too?  Until that, I can not take these.

> 

> The patches for 5.4, 5.10, and 5.12 did not need any changes. My

> understanding is that the original commits have already been queued

> for these never code trees. See the mail in stable-commits:

> 

> for 5.4:

> 

> https://www.spinics.net/lists/stable-commits/msg203482.html

> https://www.spinics.net/lists/stable-commits/msg203481.html

> 

> for 5.10:

> 

> https://www.spinics.net/lists/stable-commits/msg203486.html

> https://www.spinics.net/lists/stable-commits/msg203485.html

> 

> for 5.12:

> 

> https://www.spinics.net/lists/stable-commits/msg203494.html

> https://www.spinics.net/lists/stable-commits/msg203493.html

> 

> I am sorry, I should have mentioned this in the cover letter.


No worries, all now queued up, thanks.

greg k-h