mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Revert "printk: wake up all waiters"
@ 2022-05-26 20:30 John Ogness
  2022-05-26 20:37 ` Steven Rostedt
  2022-05-27 12:52 ` Petr Mladek
  0 siblings, 2 replies; 3+ messages in thread
From: John Ogness @ 2022-05-26 20:30 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner, linux-kernel

This reverts commit 938ba4084abcf6fdd21d9078513c52f8fb9b00d0.

The wait queue @log_wait never has exclusive waiters, so there
is no need to use wake_up_interruptible_all(). Using
wake_up_interruptible() was the correct function to wake all
waiters.

Since there are no exclusive waiters, erroneously changing
wake_up_interruptible() to wake_up_interruptible_all() did not
result in any behavior change. However, using
wake_up_interruptible_all() on a wait queue without exclusive
waiters is fundamentally wrong.

Go back to using wake_up_interruptible() to wake all waiters.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 kernel/printk/printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a3e1035929b0..ea3dd55709e7 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3904,7 +3904,7 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work)
 	}
 
 	if (pending & PRINTK_PENDING_WAKEUP)
-		wake_up_interruptible_all(&log_wait);
+		wake_up_interruptible(&log_wait);
 }
 
 static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) =
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "printk: wake up all waiters"
  2022-05-26 20:30 [PATCH] Revert "printk: wake up all waiters" John Ogness
@ 2022-05-26 20:37 ` Steven Rostedt
  2022-05-27 12:52 ` Petr Mladek
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2022-05-26 20:37 UTC (permalink / raw)
  To: John Ogness
  Cc: Petr Mladek, Sergey Senozhatsky, Thomas Gleixner, linux-kernel

On Thu, 26 May 2022 22:36:56 +0206
John Ogness <john.ogness@linutronix.de> wrote:

> This reverts commit 938ba4084abcf6fdd21d9078513c52f8fb9b00d0.
> 
> The wait queue @log_wait never has exclusive waiters, so there
> is no need to use wake_up_interruptible_all(). Using
> wake_up_interruptible() was the correct function to wake all
> waiters.
> 
> Since there are no exclusive waiters, erroneously changing
> wake_up_interruptible() to wake_up_interruptible_all() did not
> result in any behavior change. However, using
> wake_up_interruptible_all() on a wait queue without exclusive
> waiters is fundamentally wrong.
> 
> Go back to using wake_up_interruptible() to wake all waiters.

(Just to show that I have been paying attention ;-)

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
> ---
>  kernel/printk/printk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
> index a3e1035929b0..ea3dd55709e7 100644
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -3904,7 +3904,7 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work)
>  	}
>  
>  	if (pending & PRINTK_PENDING_WAKEUP)
> -		wake_up_interruptible_all(&log_wait);
> +		wake_up_interruptible(&log_wait);
>  }
>  
>  static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) =


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "printk: wake up all waiters"
  2022-05-26 20:30 [PATCH] Revert "printk: wake up all waiters" John Ogness
  2022-05-26 20:37 ` Steven Rostedt
@ 2022-05-27 12:52 ` Petr Mladek
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Mladek @ 2022-05-27 12:52 UTC (permalink / raw)
  To: John Ogness
  Cc: Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner, linux-kernel

On Thu 2022-05-26 22:36:56, John Ogness wrote:
> This reverts commit 938ba4084abcf6fdd21d9078513c52f8fb9b00d0.
> 
> The wait queue @log_wait never has exclusive waiters, so there
> is no need to use wake_up_interruptible_all(). Using
> wake_up_interruptible() was the correct function to wake all
> waiters.
> 
> Since there are no exclusive waiters, erroneously changing
> wake_up_interruptible() to wake_up_interruptible_all() did not
> result in any behavior change. However, using
> wake_up_interruptible_all() on a wait queue without exclusive
> waiters is fundamentally wrong.
> 
> Go back to using wake_up_interruptible() to wake all waiters.
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

The patch has been committed into printk/linux.git, branch
rework/printk.

I am going to create the pull request the following week
after it gets at least one spin in linux-next.

It is trivial patch so that it might be sent directly.
But it does not affect the functionality and is is not
urgent either.

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-27 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 20:30 [PATCH] Revert "printk: wake up all waiters" John Ogness
2022-05-26 20:37 ` Steven Rostedt
2022-05-27 12:52 ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®