Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp372405rdh; Tue, 19 Dec 2023 01:10:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaaADce0ba/Ul4F+hYuuLbeG9sXU7Oy4QEOBKUu/8RS7CNPDytlyTFOwv3nDhtCvzxYM43 X-Received: by 2002:a25:ace5:0:b0:dbd:4c4e:e9c4 with SMTP id x37-20020a25ace5000000b00dbd4c4ee9c4mr923376ybd.99.1702977020922; Tue, 19 Dec 2023 01:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702977020; cv=none; d=google.com; s=arc-20160816; b=kB4YEnGJhLiNDoRCBYYAtF3tDtZA6eJe65XAiaBbvTXUqiXf/rwgqxhPLg0VRFrODK zCf1PsdAVMcaJAMLEZbGbYu9Y9eZniUuPlg/JOOywJ1yx49Omi7fEVJHHMA49u9Z4XAi GkHIqIDTcbxgsaNrYrhAbWea+NfQDC+UBfwCCA4ypMd7FmO9uDAUSR6+yUTvkKXeKGxG 3lS4DYZdlGvLCITmt/pejHhXMw+grCVO8oPGuIvrFtuDLqDvO5s4Fyb5ivsoniF5eKXg eaDJa5NzsX1haRE53+PubyJZHPeoewzRCfI0m1dNdscU4byZICngUqQUS+wb37yGScIA Wvsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=MUeSDdZw8uPeQ2XORpdHymUrGMNnnZoNXCwu3+iQlGc=; fh=M4BPaMQ5Q3X2+FKbhXoDpy+/1kcj8JGJnMEJ6o+yvT4=; b=p5uaRtKa/cXPyw/eQolO98rLbGSgS6B+4BmaE80AD2QiASx/QRFxYg16uLO/zljXFM yDXsC7IUHq8TQ6P2NKPJBFlJciPkWZhxf9ajZdZCDo/NJS15qZcD4EwiejXTiCHIXUJ/ 4M89/CXymMuf8S7pbvCYQQBOIfZMh9beUlq/NgC1GG8IjoraaANQhCgPv96i0+zfz6Cw 6+SVo+zVRIvzPULfZKDAqUiKHg6nrFnWUvShbHZiQYavnP+NK++iuaarQR+E4mSKJO8A UoT+bu+jykKF1ncFVHyKFHCtMgm/BBRqacU1P2oO1fg80DN2iX4WoU+LcNMaSA6O7me6 Er5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="FLkJqo/t"; spf=pass (google.com: domain of linux-kernel+bounces-4942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w28-20020a05622a191c00b00423b115537asi27020030qtc.735.2023.12.19.01.10.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 01:10:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="FLkJqo/t"; spf=pass (google.com: domain of linux-kernel+bounces-4942-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4942-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DFEBD1C23B35 for ; Tue, 19 Dec 2023 09:09:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CE0F12E48; Tue, 19 Dec 2023 09:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FLkJqo/t" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A573134AE; Tue, 19 Dec 2023 09:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-5cdc159034eso49209a12.0; Tue, 19 Dec 2023 01:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702976971; x=1703581771; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MUeSDdZw8uPeQ2XORpdHymUrGMNnnZoNXCwu3+iQlGc=; b=FLkJqo/tLRRlWROKKRTlberWFPlEgdWloTW35BBfcTju/p8a0vGDc00UREKarUCnwM m3SFtVQj7N69L1zhEfMLUiVrJvY3asatdVD77bKnKaVxiruOc09mTwq3S5HY0R/9UqZq xrs9MNKhq7uzaQwTriVnKThBGtCj19sPwqWGdqu3HSo+zoFIxSn/puL0IcdrntpKNBEM WK6qzMi1S9JtXlMOnWZ3eWV1DwednpWODtfV4gHRvwGk51RsqaPbE8/SE/V9a65azOWv 4Jmlxi8FeHtr0UGlgZnb+TQY8qpanCLi7lJbRYkhe2FN+pYT2ylH0zBcfyyrPJI9B/zZ JihA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702976971; x=1703581771; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MUeSDdZw8uPeQ2XORpdHymUrGMNnnZoNXCwu3+iQlGc=; b=bRuxrgOP/HTOHGnKfLysWzMGgg9RSi3Qa2URCnjIv4Ld+A9/3nBPckOzjus03OM7N7 0AIxZ91XFcMFUp9qZjefxsX9+yj2Ae8GW9sCFuA7X2ks1icouYehLJMjDEOtFs3ya93H Ugb/L/ADlCJo6dLoz1+ZK35T7FrtiYLFM2RSwUw9SohFnZVwZIovmGIFcfu3LwjqDMBB YgxEjfsOYX1DjeC1Q/iGRo3x/5DviPPT2JRWmfe5LI4hI9DlE6PQG131ZIGZTFI2JYdj L5Iyqyv4Ku4KcbdsqDvxOMtFj4ctvhhj1oTcOcCxgTNLSEo8n+6bC59kH+fabThJUzKY CRdA== X-Gm-Message-State: AOJu0YwivWhthAql3SvzF6TQJBf1e3dzdjMu4CZGFmpqCAOkh9GXgAPg dNSQk2sy/jDClQUqCLhlyj4vqq8A/Ww= X-Received: by 2002:a05:6a20:7d9c:b0:190:31c1:31aa with SMTP id v28-20020a056a207d9c00b0019031c131aamr10212260pzj.49.1702976970716; Tue, 19 Dec 2023 01:09:30 -0800 (PST) Received: from carrot.. (i118-19-13-241.s42.a014.ap.plala.or.jp. [118.19.13.241]) by smtp.gmail.com with ESMTPSA id h10-20020a170902704a00b001d35223d0besm7435399plt.251.2023.12.19.01.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 01:09:29 -0800 (PST) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] nilfs2: Add missing set_freezable() for freezable kthread Date: Tue, 19 Dec 2023 18:09:18 +0900 Message-Id: <20231219090918.2329-1-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Kevin Hao The kernel thread function nilfs_segctor_thread() invokes the try_to_freeze() in its loop. But all the kernel threads are non-freezable by default. So if we want to make a kernel thread to be freezable, we have to invoke set_freezable() explicitly. Signed-off-by: Kevin Hao Signed-off-by: Ryusuke Konishi --- Andrew, please add this to the queue for the next merge window (if it's still ok). This fixes an issue where the log writer thread was not calling try_to_freeze() as intended when starting suspend or hibernation. I haven't run into any problems with or without this change in various suspend/hibernation tests so far, so I haven't added a Cc tag to the stable team. If any suspend failures are reported due to the lack of this setup, I will separately request the stable team to backport this. Thanks, Ryusuke Konishi fs/nilfs2/segment.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 52995838f2de..2590a0860eab 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -2588,6 +2588,7 @@ static int nilfs_segctor_thread(void *arg) "segctord starting. Construction interval = %lu seconds, CP frequency < %lu seconds", sci->sc_interval / HZ, sci->sc_mjcp_freq / HZ); + set_freezable(); spin_lock(&sci->sc_state_lock); loop: for (;;) { -- 2.34.1