From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED67DC433B4 for ; Mon, 12 Apr 2021 12:49:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF65F61246 for ; Mon, 12 Apr 2021 12:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241473AbhDLMt3 (ORCPT ); Mon, 12 Apr 2021 08:49:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:57788 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240790AbhDLMt2 (ORCPT ); Mon, 12 Apr 2021 08:49:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 01970B0E5; Mon, 12 Apr 2021 12:49:10 +0000 (UTC) Date: Mon, 12 Apr 2021 14:49:09 +0200 From: Daniel Wagner To: Jason Gunthorpe Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Steve Wise , Leon Romanovsky , Potnuri Bharat Teja Subject: Re: [PATCH] nvme: Drop WQ_MEM_RECLAIM flag from core workqueues Message-ID: <20210412124909.olui5hfhceakt4u4@beryllium.lan> References: <20210412122330.5166-1-dwagner@suse.de> <20210412123149.GE227011@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210412123149.GE227011@ziepe.ca> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On Mon, Apr 12, 2021 at 09:31:49AM -0300, Jason Gunthorpe wrote: > What does early init have to do with WQ_MEM_RECLAIM? 40c17f75dfa9 ("workqueue: allow WQ_MEM_RECLAIM on early init workqueues") Workqueues can be created early during boot before workqueue subsystem in fully online - work items are queued waiting for later full initialization. However, early init wasn't supported for WQ_MEM_RECLAIM workqueues causing unnecessary annoyances for a subset of users. Expand early init support to include WQ_MEM_RECLAIM workqueues. That's the connection between WQ_MEM_RECLAIM and early init. > WQ_MEM_RECLIAM is required when any thread in a reclaim context goes > to sleep waiting for a WQ to complete. For instance by calling > flush_workqueue() or many other things. > > The sleeping reclaim context must be guarenteed that the work can be > completed without the work, work queue machinery, or anything the work > has become interconnected with, recursing back into a reclaim. > > IIRC the issue here was some destroy or flush work in some error > condition that happened to be under a reclaim context? I understand what you are saying and I would totally agree with you but where is the code for this? I've grepped through the code and didn't find anything which supports the guarantee claim. Neither mm nor schedule seems to care about this flag nor workqueue.c (except the early init bits). Or I must miss something. Thanks, Daniel