From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763722AbcINTz4 (ORCPT ); Wed, 14 Sep 2016 15:55:56 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:33296 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbcINTzy (ORCPT ); Wed, 14 Sep 2016 15:55:54 -0400 Date: Wed, 14 Sep 2016 15:55:51 -0400 From: Tejun Heo To: Linus Torvalds Cc: Waiman Long , "Theodore Ts'o" , Arnd Bergmann , Greg Kroah-Hartman , Linux Kernel Mailing List , Scott J Norton , Douglas Hatch Subject: Re: [PATCH] random: Fix kernel panic due to system_wq use before init Message-ID: <20160914195551.GA6832@htj.duckdns.org> References: <1473879781-23819-1-git-send-email-Waiman.Long@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Linus. On Wed, Sep 14, 2016 at 12:14:30PM -0700, Linus Torvalds wrote: > 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? We've used keventd_up() for this purpose and it hasn't been big enough an issue as workqueue usages during earlyboot are very rare (only five users right now). But, yeah, it's getting used a more and more and there's no harm in moving it to earlier. I'll see how early I can push it. Thanks. -- tejun