2022-04-21 21:23:40

by John Ogness

[permalink] [raw]
Subject: [PATCH printk v3 04/15] printk: wake up all waiters

There can be multiple tasks waiting for new records. They should
all be woken. Use wake_up_interruptible_all() instead of
wake_up_interruptible().

Signed-off-by: John Ogness <[email protected]>
---
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 f817dfb4852d..e23357002648 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3326,7 +3326,7 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work)
}

if (pending & PRINTK_PENDING_WAKEUP)
- wake_up_interruptible(&log_wait);
+ wake_up_interruptible_all(&log_wait);
}

static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) =
--
2.30.2


2022-04-22 05:38:41

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH printk v3 04/15] printk: wake up all waiters

On Wed 2022-04-20 01:52:26, John Ogness wrote:
> There can be multiple tasks waiting for new records. They should
> all be woken. Use wake_up_interruptible_all() instead of
> wake_up_interruptible().
>
> Signed-off-by: John Ogness <[email protected]>

Another great catch!

Reviewed-by: Petr Mladek <[email protected]>

Best Regards,
Petr