From patchwork Mon Mar 27 20:46:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9647451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 209EE601D7 for ; Mon, 27 Mar 2017 20:46:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 110782840E for ; Mon, 27 Mar 2017 20:46:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0569F2843B; Mon, 27 Mar 2017 20:46:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E67C2840E for ; Mon, 27 Mar 2017 20:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbdC0Uq1 (ORCPT ); Mon, 27 Mar 2017 16:46:27 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:44997 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbdC0Uq0 (ORCPT ); Mon, 27 Mar 2017 16:46:26 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v2RKkEf0017789 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Mar 2017 20:46:14 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v2RKkEso001976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 27 Mar 2017 20:46:14 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v2RKkDkW013222; Mon, 27 Mar 2017 20:46:13 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 27 Mar 2017 13:46:13 -0700 Date: Mon, 27 Mar 2017 13:46:11 -0700 From: "Darrick J. Wong" To: linux-pm@vger.kernel.org, xfs Subject: [PATCH] xfs: don't let suspend freeze the buffer workqueue Message-ID: <20170327204611.GA4864@birch.djwong.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Suspend has this annoying behavior in XFS where it freezes workqueues in some arbitrary order. This is a problem because the sync call can cause an AIL push, which may have to perform a RMW cycle on an inode cluster buffer if that buffer has been reclaimed. When this happens, the AIL issues a buffer read for which the io completion ends up on the xfs_buf workqueue. If /that/ workqueue has already been frozen, the suspend will timeout because we froze the workqueues in the wrong order. It seems suspicious to be freezing IO helper threads[1], so let's just not do that anymore. Prior to this patch, 4.10 fails to suspend on my laptop about 80% of the time; afterwards, it works every time. I've not done much suspend-and-crash testing on it though. [1] https://lwn.net/Articles/705269/ Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 7af5ca9..216ab89 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -842,7 +842,7 @@ xfs_init_mount_workqueues( struct xfs_mount *mp) { mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", - WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_fsname); + WQ_MEM_RECLAIM, 1, mp->m_fsname); if (!mp->m_buf_workqueue) goto out;