From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753422AbcBWPeN (ORCPT ); Tue, 23 Feb 2016 10:34:13 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:50314 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752720AbcBWPeK (ORCPT ); Tue, 23 Feb 2016 10:34:10 -0500 Date: Tue, 23 Feb 2016 10:34:09 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Peter Chen cc: tj@kernel.org, , , , Subject: Re: Freezable workqueue blocks non-freezable workqueue during the system resume process In-Reply-To: <20160223032056.GB12256@shlinux2.ap.freescale.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Feb 2016, Peter Chen wrote: > Hi Tejun Heo and Florian Mickler, > > I have a question that during the system resume process, the freezable > workqueue can be thawed if there is a non-freezable workqueue is > blocked (At uninterruptable state)? > > My case like below, I have a USB OTG (Micro-AB) cable is at USB > Micro-B port, and there is a USB driver on it, and un-plug this > cable can wake up system from the suspend. There is a non-freezable > workqueue ci_otg will be scheduled after disconnecting OTG cable, > and in its worker ci_otg_work, it will try to disconnect USB drive, > and flush disk information. These operations probably are not safe while the system is resuming. It might be best to make them wait until the resume is finished. > But flush disk information is done by > freezable workqueue writeback, it seeems workqueue writeback is > never got chance to execute, the workqueue ci_otg is waiting there > forever, and the system is deadlock. > Both change workqueue ci_otg as freezable or change workqueue writeback > as non-freezable can fix this problem. It sounds like making ci_otg freezable is the easiest solution. > Please ignore it, the system is locked at driver's resume, > maybe at scsi or usb driver, so of cos, the freezable processes > can't be thawed. > > [ 555.263177] [] (flush_work) from [] (flush_delayed_work+0x48/0x4c) > > [ 555.271106] r8:ed5b5000 r7:c0b38a3c r6:eea439cc r5:eea4372c r4:eea4372c > > [ 555.277958] [] (flush_delayed_work) from [] (bdi_unregister+0x84/0xec) > > [ 555.286236] r4:eea43520 r3:20000153 > > [ 555.289885] [] (bdi_unregister) from [] (blk_cleanup_queue+0x180/0x29c) > > [ 555.298250] r5:eea43808 r4:eea43400 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? Alan Stern