[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57D9A400.2010501@hpe.com>
Date: Wed, 14 Sep 2016 15:24:48 -0400
From: Waiman Long <waiman.long@....com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
CC: Tejun Heo <tj@...nel.org>, Theodore Ts'o <tytso@....edu>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Scott J Norton <scott.norton@....com>,
Douglas Hatch <doug.hatch@....com>
Subject: Re: [PATCH] random: Fix kernel panic due to system_wq use before
init
On 09/14/2016 03:14 PM, Linus Torvalds wrote:
> Ugh, I detest this patch.
>
> My gut feeling is that a driver (even a fairly core one like the
> random code) should not have to know these kinds of details like
> "schedule_work() needs system_wq to have been initialized".
>
> I'm wondering if we couldn't just initialize "system_wq" earlier.
> Right now init_workqueues() is an "early_initcall()", so it's at the
> same priority as a number of other random early initcalls. My gut
> feeling is that it should be initialized even earlier, with the
> scheduler.
>
> Because dammit, we use "schedule_work()" as if it was a pretty core
> scheduler thing, and having to have some odd knowledge of system_wq
> initialization details in the rest of the kernel sounds really really
> wrong.
>
> I don't think the random code is at all special in maybe wanting to
> schedule some work despite being an "early" initcall.
>
> Adding Tejun to the cc, and quoting the whole email.
>
> Tejun, comments?
>
> Linus
>
>
My patch does not really fix the boot problem as detailed in my
follow-up email. It serves mostly to jump start the discussion on the
problem that I saw. The schedule_work() call was issued as part of
interrupt handling that seems to be started pretty early in the boot
process before the early_initcall. I guess it is possible to move the
initialization earlier, but I am not sure where will be a good place.
Cheers,
Longman
Powered by blists - more mailing lists