Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1978015ybi; Thu, 20 Jun 2019 07:10:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxqKSLcC/KCFLKsYziC2DpVhZ2kZFKOYHn1WcSxPo11sQnTeOe6wONzgoCUVWdLUvFEilF X-Received: by 2002:a17:90a:9b08:: with SMTP id f8mr3327734pjp.103.1561039825521; Thu, 20 Jun 2019 07:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561039825; cv=none; d=google.com; s=arc-20160816; b=f2Mz/JndWpEbeDs3piilLgkZ+L+73svglsrTFfrje2TfXDYNOjtdHT9pTrudReTmeB HsXNPmFmX5iIrX1cXggB3DTPszl+NbdTjLsRuPOlBS01VOpqU30D+XFwmQstXoJCNeuf jVY6tCKFcCGlcVXLNXOHkPFjPamBLjA96kAIqz5+gDPwJZEpG6nTOXoabnWRqSRqWVTS 8FiDjYao3WJti76ApB9fGMd4Gf7GJ4T4iDLleu8HArsrCU4APBZux093hqHk8SWdjJXi M2rmyNrFZqEXxopRpSQorwGdIFBD+12lnWPq9PaA74iiARv0aHjfHFV0BM9LlnmKFoUS cB8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lCea24nGIZCu7ydKVsC+l/7geTYb5i00s0rd6yWS+Lo=; b=aUms8wYonblM/jqbcaHRmop5DhImgXwFktKBc8xkRs9b/TcPeKY9DtmXWRuFaPtFUK DVuNRJWc6ElbS0Q1s142SVoydjTuyY5jZFLLqFd5IA4Tt7YXhboGajK70EbwpoD/8qtA wcXt5YqxZ1J3WAWG8oemDUhRpDHqwLloBMo8HTiID7PM7wZoPK2J2n2l+pGa3EuUaAgS WVEFMN8EKXlh4c6OL8CfIN89rNsZMnUOwUBu2F07eB0M/+kxjcluS2YSJHcEXdDuO0Ql SGezDIENYm+DnT+9iJOHDGV92auTeSE7ByJc1LFUnYgffP2wIJ3ISAw8mtyCyJyZu64u 5PzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IWe8EDOo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i184si19503593pfb.123.2019.06.20.07.10.08; Thu, 20 Jun 2019 07:10:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IWe8EDOo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbfFTOKE (ORCPT + 99 others); Thu, 20 Jun 2019 10:10:04 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33809 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbfFTOKE (ORCPT ); Thu, 20 Jun 2019 10:10:04 -0400 Received: by mail-pf1-f196.google.com with SMTP id c85so1763472pfc.1; Thu, 20 Jun 2019 07:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lCea24nGIZCu7ydKVsC+l/7geTYb5i00s0rd6yWS+Lo=; b=IWe8EDOoK2wLDjqbj0Q5/jydeaDsHVyB9wekftRSAfWJT9rXjLQbWXWfgQVqkmTAON Pkh5w12/Qbk8ywybCXAes9aRTnj0/CVDTJlOHgtFSaObrK8Tg+iWLnl+xP6E6P70ZyU0 NUvXvIJkgxm1DNoPCrYGWXkyzEzgeNWmuUpLXvwJBOPSNAtsKdp4Cyv4ujTrWU+ns7ag +FvvsUK/Fx3fOzQQ0TGFCKqtZm8XxmiYQ1AFK5ZhnyOMtdBaTECVvndIgna8S0cKxUZh DOnco2bN23vOj+4CqKWqGno7Ka9gU24ZMgOxJKyap/SHvXiRoR2ydSewJmFHRYEe2kTW 4nyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=lCea24nGIZCu7ydKVsC+l/7geTYb5i00s0rd6yWS+Lo=; b=ZiA+kS+eCTd8SUnE4iZsghJtRWF0TqE82pNwMO6tzTFz41C+yErzJ4veFRJNuWgvJr P7kjpGL5gImh/ktfKG3zo+GD28PAHh7Ej1UnWDN7MIehOAtriUheIf6huqyD+osB581j kN4ECfL1wTJpl1LdEejnmZqiLnJtBojwOUE2rf8mL855xi6zCTmbIU8f7GKaGkahd0Mg 9o0MFX/qTR8YmXUM9IfzmfwhdlQ+Ri3dlza9o4JYB4uNHn4uWDV6JV4SwzMg2ynzVn0m TkwVrLipXfQphAjZyNdnWGCXxl9alyoQCsCQyPD5uo32kAfNPC007T089sdpu2uxO154 mcrA== X-Gm-Message-State: APjAAAXUpspHkdJs/O6UCiFxGMYm8vC3IU3KFdgw6jak5mtnW+CVJZeu XfTBGveGrB6G5lhnyaw3TmCQqdy6mJE= X-Received: by 2002:a17:90a:8a15:: with SMTP id w21mr3334565pjn.134.1561039803189; Thu, 20 Jun 2019 07:10:03 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::2:a5e4]) by smtp.gmail.com with ESMTPSA id d132sm23393702pfd.61.2019.06.20.07.10.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2019 07:10:02 -0700 (PDT) Date: Thu, 20 Jun 2019 07:10:00 -0700 From: Tejun Heo To: Alan Stern Cc: Oliver Neukum , USB list , Kernel development list Subject: Re: [RFC] deadlock with flush_work() in UAS Message-ID: <20190620140937.GJ657710@devbig004.ftw2.facebook.com> References: <1560871774.3184.16.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, Jun 18, 2019 at 11:59:39AM -0400, Alan Stern wrote: > > > Even if you disagree, perhaps we should have a global workqueue with a > > > permanently set noio flag. It could be shared among multiple drivers > > > such as uas and the hub driver for purposes like this. (In fact, the > > > hub driver already has its own dedicated workqueue.) > > > > That is a good idea. But does UAS need WQ_MEM_RECLAIM? > > These are good questions, and I don't have the answers. Perhaps Tejun > or someone else on LKML can help. Any device which may host a filesystem or swap needs to use WQ_MEM_RECLAIM workqueues on anything which may be used during normal IOs including e.g. error handling which may be invoked. One WQ_MEM_RECLAIM workqueue guarantees one level of concurrency for all its tasks regardless of memory situation, so as long as there's no interdependence between work items, the workqueue can be shared. Thanks. -- tejun