[PATCH] Add printk-debug statements

From: Marc Hartmayer
Date: Wed Sep 11 2024 - 05:11:41 EST


Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
---
kernel/workqueue.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e7b005ff3750..d4c5c68457f7 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3338,11 +3338,16 @@ static void set_pf_worker(bool val)
static int worker_thread(void *__worker)
{
struct worker *worker =3D __worker;
- struct worker_pool *pool =3D worker->pool;
+ if (unlikely(!worker))
+ printk(KERN_ERR "OOOOOHHHH NOOOOOOO, WE DO NOT HAVE A WORKE=
R.\n");
+
+ struct worker_pool *pool =3D READ_ONCE(worker->pool);

/* tell the scheduler that this is a workqueue worker */
set_pf_worker(true);
woke_up:
+ if (unlikely(!pool))
+ printk(KERN_ERR "OOOOOHHHH NOOOOOOO, WE DO NOT HAVE A POOL.=
\n");
raw_spin_lock_irq(&pool->lock);

/* am I supposed to die? */
--
2.43.0

And it shows that pool is NULL in case of the crash. Hope this helps.

>
> Thanks for having a look!
>
>>
>> Thanks
>> Lai
> --=20
> Kind regards / Beste Gr=C3=BC=C3=9Fe
> Marc Hartmayer
>
> IBM Deutschland Research & Development GmbH
> Vorsitzender des Aufsichtsrats: Wolfgang Wendt
> Gesch=C3=A4ftsf=C3=BChrung: David Faller
> Sitz der Gesellschaft: B=C3=B6blingen
> Registergericht: Amtsgericht Stuttgart, HRB 243294
--=20
Kind regards / Beste Gr=C3=BC=C3=9Fe
Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Gesch=C3=A4ftsf=C3=BChrung: David Faller
Sitz der Gesellschaft: B=C3=B6blingen
Registergericht: Amtsgericht Stuttgart, HRB 243294