Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp722410ybp; Fri, 4 Oct 2019 04:03:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJrPcqcj9QoaeXmCGOIEzj1GLlkWx3E6cD+1my8SKY/ScYTfdy6HAqi8SPXVukNoWQq509 X-Received: by 2002:a17:906:5c01:: with SMTP id e1mr12064706ejq.209.1570186984892; Fri, 04 Oct 2019 04:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570186984; cv=none; d=google.com; s=arc-20160816; b=w3EB12avUIE2HG3P/RTqnLWgHec1ZPM8rznObUPqG0G4K857AgRBVs2hUroj3zXS6/ Di9WtRWHwJc3oC/t3miXImOdw51o5BnHV0VkbaAF6bQUzjYsg0QQmv6Gc7qLv7KyRePG CFH9MGxsHRirBu1dKWHz2OBY/Jjl2EkkN0ag0Svcrs0O7YHuC4GYE5y8m/F2sulTByQ9 R14WoIy2wTnGE2NkRKkAkpAFJRefHa9MXhI0gyCnCuV0WDMPpYBoxIp6WSQ1FRsXtEx5 2xYA0+1Igsv5ZyM6ReOzLBg7yDzFuCsj5A+eR5bkFk+DEipbhITl6t8wwfLGLb+AsrcA N0Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cf8vdnJIbwsXdLZSfdbqgyff5WI/yCumU1YQVdzoO00=; b=nB6EWyf/A2jw2voPEfuld4+LzQ3/LSIhkuItqG19PGB31Um3MqUtm30J18LMvyHTMi UTdRsmoDWPBBP1MxJyQT4iUSIaw/NAmbZJm/Ool4BFeTlz9SzXKd2hY+NYStkDuJPDbx kxARiEqfab/TEc9BVXxTLVAvm60gkx+Q+CqVq7EDCLoyP4OcKOEm9ZetgIA1YZIgdo5F 6wP5PXwG/FMBuZEP+oCZWTJNKbE++oxOQKL+SEsLeSzhtL3tM50vBALzJrtmuT/wwOTy TvUGQ1/G2zd+vt7SPPuRONBD4LL3tzigZdAv1PZv7Pczku83Y6cTrAbluVblxj9wiNwW W2JA== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si3206851edw.348.2019.10.04.04.02.39; Fri, 04 Oct 2019 04:03:04 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729921AbfJDLCD (ORCPT + 99 others); Fri, 4 Oct 2019 07:02:03 -0400 Received: from mga09.intel.com ([134.134.136.24]:54953 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbfJDLCD (ORCPT ); Fri, 4 Oct 2019 07:02:03 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Oct 2019 04:01:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,256,1566889200"; d="scan'208";a="205829698" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 04 Oct 2019 04:01:52 -0700 Received: by lahna (sSMTP sendmail emulation); Fri, 04 Oct 2019 14:01:51 +0300 Date: Fri, 4 Oct 2019 14:01:51 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Tejun Heo , "Rafael J. Wysocki" , AceLan Kao , Jens Axboe , Jan Kara , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: System hangs if NVMe/SSD is removed during suspend Message-ID: <20191004110151.GH2819@lahna.fi.intel.com> References: <20191002122136.GD2819@lahna.fi.intel.com> <20191003165033.GC3247445@devbig004.ftw2.facebook.com> <20191004080340.GB2819@lahna.fi.intel.com> <2367934.HCQFgJ56tP@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2367934.HCQFgJ56tP@kreacher> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 04, 2019 at 11:59:26AM +0200, Rafael J. Wysocki wrote: > On Friday, October 4, 2019 10:03:40 AM CEST Mika Westerberg wrote: > > On Thu, Oct 03, 2019 at 09:50:33AM -0700, Tejun Heo wrote: > > > Hello, Mika. > > > > > > On Wed, Oct 02, 2019 at 03:21:36PM +0300, Mika Westerberg wrote: > > > > but from that discussion I don't see more generic solution to be > > > > implemented. > > > > > > > > Any ideas we should fix this properly? > > > > > > Yeah, the only fix I can think of is not using freezable wq. It's > > > just not a good idea and not all that difficult to avoid using. > > > > OK, thanks. > > > > In that case I will just make a patch that removes WQ_FREEZABLE from > > bdi_wq and see what people think about it :) > > I guess that depends on why WQ_FREEZABLE was added to it in the first place. :-) > > The reason might be to avoid writes to persistent storage after creating an > image during hibernation, since wqs remain frozen throughout the entire > hibernation including the image saving phase. Good point. > Arguably, making the wq freezable is kind of a sledgehammer approach to that > particular issue, but in principle it may prevent data corruption from > occurring, so be careful there. I tried to find the commit that introduced the "freezing" and I think it is this one: 03ba3782e8dc writeback: switch to per-bdi threads for flushing data Unfortunately from that commit it is not clear (at least to me) why it calls set_freezable() for the bdi task. It does not look like it has anything to do with blocking writes to storage while entering hibernation but I may be mistaken.