From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2FDD17F37 for ; Wed, 20 Jan 2016 02:48:01 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id E51778F8033 for ; Wed, 20 Jan 2016 00:47:57 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id DVinrovMapiAG4ag (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 20 Jan 2016 00:47:52 -0800 (PST) Date: Wed, 20 Jan 2016 09:47:50 +0100 From: Michal Hocko Subject: Re: [PATCH] Revert "xfs: clear PF_NOFREEZE for xfsaild kthread" Message-ID: <20160120084750.GA14187@dhcp22.suse.cz> References: <1452661968-11482-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1452661968-11482-1-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: jkosina@suse.cz, Hendrik Woltersdorf , xfs@oss.sgi.com On Wed 13-01-16 16:12:48, Dave Chinner wrote: > This reverts commit 24ba16bb3d499c49974669cd8429c3e4138ab102 as it > prevents machines from suspending. This regression occurs when the > xfsaild is idle on entry to suspend, and so there s no activity to > wake it from it's idle sleep and hence see that it is supposed to > freeze. Hence the freezer times out waiting for it and suspend is > cancelled. > > There is no obvious fix for this short of freezing the filesystem > properly, so revert this change for now. We had a similar report opensuse bugzilla just recently. I believe the proper fix should be the following: --- >>From ae910a86ada86804c34cc8136afebc9fefa15813 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Tue, 19 Jan 2016 20:28:49 +0100 Subject: [PATCH] xfs, xfsaild: Do not block suspend Hendik has reported suspend failures due to xfsaild blocking the freezer to settle down. Jan 17 19:59:56 linux-6380 kernel: PM: Syncing filesystems ... done. Jan 17 19:59:56 linux-6380 kernel: PM: Preparing system for sleep (mem) Jan 17 19:59:56 linux-6380 kernel: Freezing user space processes ... (elapsed 0.001 seconds) done. Jan 17 19:59:56 linux-6380 kernel: Freezing remaining freezable tasks ... Jan 17 19:59:56 linux-6380 kernel: Freezing of tasks failed after 20.002 seconds (1 tasks refusing to freeze, wq_busy=0): Jan 17 19:59:56 linux-6380 kernel: xfsaild/dm-5 S 00000000 0 1293 2 0x00000080 Jan 17 19:59:56 linux-6380 kernel: f0ef5f00 00000046 00000200 00000000 ffff9022 c02d3800 00000000 00000032 Jan 17 19:59:56 linux-6380 kernel: ee0b2400 00000032 f71e0d00 f36fabc0 f0ef2d00 f0ef6000 f0ef2d00 f12f90c0 Jan 17 19:59:56 linux-6380 kernel: f0ef5f0c c0844e44 00000000 f0ef5f6c f811e0be 00000000 00000000 f0ef2d00 Jan 17 19:59:56 linux-6380 kernel: Call Trace: Jan 17 19:59:56 linux-6380 kernel: [] schedule+0x34/0x90 Jan 17 19:59:56 linux-6380 kernel: [] xfsaild+0x5de/0x600 [xfs] Jan 17 19:59:56 linux-6380 kernel: [] kthread+0x9b/0xb0 Jan 17 19:59:56 linux-6380 kernel: [] ret_from_kernel_thread+0x21/0x38 The issue has been there for quite some time but it has been made visible by only by 24ba16bb3d49 ("xfs: clear PF_NOFREEZE for xfsaild kthread") because the suspend started seeing xfsaild. The above commit has missed that the !xfs_ail_min branch might call schedule with TASK_INTERRUPTIBLE without calling try_to_freeze so the pm suspend would wake up the kernel thread over and over again without any progress. What we want here is to use freezable_schedule instead to hide the thread from the suspend. While we are here also change schedule_timeout to freezable variant to prevent from spurious wakeups by suspend. Reported-by: Hendrik Woltersdorf Signed-off-by: Michal Hocko --- fs/xfs/xfs_trans_ail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index aa67339b9537..d6c9c3e9e02b 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c @@ -520,14 +520,14 @@ xfsaild( if (!xfs_ail_min(ailp) && ailp->xa_target == ailp->xa_target_prev) { spin_unlock(&ailp->xa_lock); - schedule(); + freezable_schedule(); tout = 0; continue; } spin_unlock(&ailp->xa_lock); if (tout) - schedule_timeout(msecs_to_jiffies(tout)); + freezable_schedule_timeout(msecs_to_jiffies(tout)); __set_current_state(TASK_RUNNING); -- 2.7.0.rc3 -- Michal Hocko SUSE Labs _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs