From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F24C13B5AE for ; Wed, 18 Mar 2026 04:03:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773806595; cv=none; b=XmyvxxgYff9uQ2/CCPxX1jNdek8r4FaAh4ciOzlEbkKBvKJCtU3VC0f5HTRDfkSjaqgipju+eWFcT3KnyZxg0o+XhaM+u8vP4AZ7ekT+ef59qobjykndBM7PYUsIdrWJ2qc74CHqiQNn3//wx6OWhN7v+iqB5jMKCuZLi3jCTT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773806595; c=relaxed/simple; bh=uo8IwZ+QJ23+L4LoOhLmPA7dGtlrCWIGhHTduxhKTm0=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=G6R/BqKIfnIv5sUqia3/XaKNnV8PIImqh3m7beXsevUeZD74m0zdGlyxszVOd51EMCaT3vs0uhxR+oyEdEEbcrUvUrP6x74IGGs2/FdVTJ7ytFUdPsSHPolEzwtezTIvonDTGVWbk15kcAxF/OS1nQPnEE4OibbupXxbsF+goIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cknwmSxK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cknwmSxK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C02DFC19421; Wed, 18 Mar 2026 04:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773806595; bh=uo8IwZ+QJ23+L4LoOhLmPA7dGtlrCWIGhHTduxhKTm0=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=cknwmSxKWLKQLh4ROO8Sk0WAn01RzKfzgBP/1xV/mgW6ortcIwimFC+vU7ZXmJfZq 7kr9SFZ86oUj6Zvn3/63zfsSydXP5u3wPgncsNGbobBEj9r4+eT4UGuHeTpxQ1Ze57 ZWCrafv6GcbUJ52k7e+p5xhv/chyPaj7xlZkwpTe/Rsg29KBeaUtgIIPaLxQXkk/9j 0h2QVa9AwgCxlHCkzwn3ZkuVGKm3rBRuMMO0rdx3D5WT9Q+zpSGBeA+gpccG1wgsFr BWztPburX5sp2fwZLhN2leIjcuE91Xe//t36Tti0+8VI3mADmeIrYDhrI9FfOjPXsj nG1deLCFf3Gkg== Message-ID: Date: Wed, 18 Mar 2026 12:03:11 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH v3] f2fs: fix to freeze GC and discard threads quickly To: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com References: <20260316185954.2185806-1-daeho43@gmail.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260316185954.2185806-1-daeho43@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2026/3/17 02:59, Daeho Jeong wrote: > From: Daeho Jeong > > Suspend can fail if kernel threads do not freeze for a while. > f2fs_gc and f2fs_discard threads can perform long-running operations > that prevent them from reaching a freeze point in a timely manner. > > This patch adds explicit freezing checks in the following locations: > 1. f2fs_gc: Added a check at the 'retry' label to exit the loop quickly > if freezing is requested, especially during heavy GC rounds. > 2. __issue_discard_cmd: Added a 'suspended' flag to break both inner and > outer loops during discard command issuance if freezing is detected > after at least one command has been issued. > 3. __issue_discard_cmd_orderly: Added a similar check for orderly discard > to ensure responsiveness. > > These checks ensure that the threads release locks safely and enter the > frozen state. > > Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Thanks,