From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932242AbcCCJcy (ORCPT ); Thu, 3 Mar 2016 04:32:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:46412 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932200AbcCCJcv (ORCPT ); Thu, 3 Mar 2016 04:32:51 -0500 Date: Thu, 3 Mar 2016 10:33:10 +0100 From: Jan Kara To: Tejun Heo Cc: Peter Chen , Alan Stern , florian@mickler.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, Jan Kara , jkosina@suse.cz Subject: Re: Freezable workqueue blocks non-freezable workqueue during the system resume process Message-ID: <20160303093310.GC2307@quack.suse.cz> References: <20160223032056.GB12256@shlinux2.ap.freescale.net> <20160224072430.GC15452@shlinux2.ap.freescale.net> <20160225220112.GM6092@mtj.duckdns.org> <20160226061920.GA17288@shlinux2.ap.freescale.net> <20160302160058.GA29826@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160302160058.GA29826@mtj.duckdns.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed 02-03-16 11:00:58, Tejun Heo wrote: > On Fri, Feb 26, 2016 at 02:19:20PM +0800, Peter Chen wrote: > > On Thu, Feb 25, 2016 at 05:01:12PM -0500, Tejun Heo wrote: > > > Hello, Peter. > > > > > > On Wed, Feb 24, 2016 at 03:24:30PM +0800, Peter Chen wrote: > > > > > You might want to complain to the block-layer people about this. I > > > > > don't know if anything can be done to fix it. > > > > > > > > > > Or maybe flush_work and flush_delayed_work can be changed to avoid > > > > > blocking if the workqueue is frozen. Tejun? > > > > > > > > > > > > > I have a patch to show the root cause of this issue. > > > > > > > > http://www.spinics.net/lists/linux-usb/msg136815.html > > > > > > I don't get it. Why would it deadlock? Shouldn't things get rolling > > > once the workqueues are thawed? > > > > The workqueue writeback can't be thawed due to driver's resume > > (dpm_complete) is lock nested, and can't be finished. > > Ugh... that's nasty. I wonder whether the right thing to do is making > writeback workers non-freezable. IOs are supposed to be blocked from > lower layer anyway. Jan, what do you think? Well no, at least currently IO is not blocked in lower layers AFAIK - for that you'd need to freeze block devices & filesystems and there are issues with that (Jiri Kosina was the last one which was trying to make this work AFAIR). And I think you need to stop writeback (and generally any IO) to be generated so that it doesn't interact in a strange way with device drivers being frozen. So IMO until suspend freezes filesystems & devices properly you have to freeze writeback workqueue. Honza -- Jan Kara SUSE Labs, CR