Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp19234imu; Thu, 8 Nov 2018 14:02:00 -0800 (PST) X-Google-Smtp-Source: AJdET5eowHlzYD7OuZ0SgVOPj59YO7l4eEaBTuw/i+CyUH50ffKdskmphAW3nshn3QEUOaGu+vUi X-Received: by 2002:a63:6cc:: with SMTP id 195mr5308119pgg.52.1541714520389; Thu, 08 Nov 2018 14:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714520; cv=none; d=google.com; s=arc-20160816; b=qdpbn3ot8ysDS2AwVJMNyO1I1+RBka9h9nqei8n0IUSlrI4D+hPR7TjGi8S0R+FB+Q vT3C7uIjwENAl7VsAUWImuJ1ayJlrWAI7VQaL9B1V30tsvwmpaX9VpfXFRW5JRCB+TzE JbE1MDJJ8KsBEPbqMLDSgA03gDVR/H4o757DEKBjFWW9+fehtE+jr55lsbaS7O5Gg2US BoOENAn95G2RohD7vnEJQh363TlRgRrW0XFOvTOPs31gx1AR6lUxuQ45gAPk9fVk71MU pKR7704FZolEFEHOqDoN3d+GZaVjb9IXLFhMxEDcYfnNBYNOIX9Ar7Z5j48A1uH/LgTU H9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JuqoIUp6YxJbGygc2CzsszAWrGNTj4r9en/qDCtWL1M=; b=Le6YctkdH6v22sGMv0Bd2/UlC9gA5azwBt0RY5tzNXfK4DGa5q5I8sQGirLc2azC2U a5dOPrGjbt5CanrsbnNMrsamgUlO2UhZfZ5ErLjaqcY4DXZ/j1ikqDavrCM7MZb9Hjwr M1ZoKe3Eg87UUXDMvv1k09Rc1S7T3MZQ9Famuw1TuhJ3O7w9ktRRy4zwwjx3x8Dz/4Z9 3IQYEYdQ98Rj/yKxV9VfYi8H/JXCy2LO4XNXe83i8SRmMvnOqA/eGniqvdsrfXTHdUhh FbsPw8pBEBlyg/i+WCfgfJ0BeeYVZOr106HCgER7InEO8XJ8fFOZTGghYDv4pVGl3KfS jRRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IsuUujmc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s65-v6si5572707pfa.157.2018.11.08.14.01.26; Thu, 08 Nov 2018 14:02:00 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=IsuUujmc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729906AbeKIHgh (ORCPT + 99 others); Fri, 9 Nov 2018 02:36:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:54142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728284AbeKIHgg (ORCPT ); Fri, 9 Nov 2018 02:36:36 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 007C120892; Thu, 8 Nov 2018 21:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714348; bh=gZgzQQnKU6YjV1AdLCTxMmFhJhYaEwaZeY+EHTUBDic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsuUujmcm+zX9+IjAbU2edvjqEsA0mnENfkaWcp1YD1Ime0+WW05v6zBwSdKMEtam 2utHE3gGrJObJSfqyqfve4j3DLNWML/uu/zS43rpuvV3uWEdePN1Qu1NP5udu5KTbS Go8mB7D/K0wyk5bpNqri0ffhMsfFMv0rDf9MsctU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Kosina , David Sterba , Sasha Levin Subject: [PATCH 4.4 026/114] btrfs: cleaner_kthread() doesnt need explicit freeze Date: Thu, 8 Nov 2018 13:50:41 -0800 Message-Id: <20181108215101.483013816@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 838fe1887765f4cc679febea60d87d2a06bd300e ] cleaner_kthread() is not marked freezable, and therefore calling try_to_freeze() in its context is a pointless no-op. In addition to that, as has been clearly demonstrated by 80ad623edd2d ("Revert "btrfs: clear PF_NOFREEZE in cleaner_kthread()"), it's perfectly valid / legal for cleaner_kthread() to stay scheduled out in an arbitrary place during suspend (in that particular example that was waiting for reading of extent pages), so there is no need to leave any traces of freezer in this kthread. Fixes: 80ad623edd2d ("Revert "btrfs: clear PF_NOFREEZE in cleaner_kthread()") Fixes: 696249132158 ("btrfs: clear PF_NOFREEZE in cleaner_kthread()") Signed-off-by: Jiri Kosina Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index ae6e3a30e61e..a2001abbe379 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1820,7 +1820,7 @@ static int cleaner_kthread(void *arg) */ btrfs_delete_unused_bgs(root->fs_info); sleep: - if (!try_to_freeze() && !again) { + if (!again) { set_current_state(TASK_INTERRUPTIBLE); if (!kthread_should_stop()) schedule(); -- 2.17.1