From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (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 2EAEA3909A1 for ; Mon, 9 Mar 2026 10:37:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773052652; cv=none; b=Lkkh6s0AYCreoWUttZNZ1ndgFtfdEiORfwg/J14JC/xZvwFxeuaJoJ9YBalwqwtoeRAwbv2y/vlQGfb8O6TSay28YrbyBgXbmuGkjmgW3Nh0n4u7O1EVR9acnsLFaFD21Gpgld3+ZDMeKqdOdP2DJgZWdammqvRXVbpXallW3Es= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773052652; c=relaxed/simple; bh=sg6gUMDzaeWMrQxjNab0672YjdY3ug4+iKnEAEpnD5I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dcWuc++7qdhLGnBtloSRZYJDD6whH5vy6x9wTNsJ7lga434zS7BGfvMofs5CFU25MXEMybtv+HTi4NKK065tCp+JOewtJ5+Dv/pwXKcHDe6CPssEQNkG1+Sh/LWNHjb01HVH8DbOpdnVd0XomVBRhKSKWkZt0qOMhjZIiXfmL5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CBo4KGcr; arc=none smtp.client-ip=209.85.210.46 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CBo4KGcr" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-7d1872504cbso8222342a34.0 for ; Mon, 09 Mar 2026 03:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773052650; x=1773657450; 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=3n7XWtMSYt33OB5GLqeAcUX1zFZSJspqo7CjV/jPPgA=; b=CBo4KGcrzZNXHKKdNB+N8UV4TPIrbfz7QMhpDI+Rg4ZaPYcCh1Njm/CJ45knRMdrjH 5um5etE6xM9BbgofML8QAVWPPEqOjJPjrZdL2i8X4Fbx4EL18jOJFXwRu+y98LSxPy1t MmzhDo1OY5XnXD910S0pScvsXF6DDBu8anSCf5p9QoeidaMq3tNSqoWnURd9TByfRT0D Q4fFwjdywuo2KU6tJV/L//HoR5YzdISj88Ag2PzRqKQRh3LYRB3d23li/MJMp2uWnjOe oZqrLe9ry3tVbszJPRu1o6/cwO0K5Sco/R8N/k2irBX3JfpiwvL53qnJo/ODWgBEMfwh 9TPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773052650; x=1773657450; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3n7XWtMSYt33OB5GLqeAcUX1zFZSJspqo7CjV/jPPgA=; b=RhP0PRrNMLDXWVUOHjE1hJma6van7SfoKO+AeiJ2qbxpgS4VthjQnyqqpIQugNetMh vnb3LlZXsdP4WVKn8wtPMDyFpaC4O2/Qp6Byo4qXomrfNePgkBDDVdMP5RVTiKnlg5vF 6v17S8snnXF+3jqQVlV4Edhq0gzozx1ovsv5VJghthaH2Sk3jwN4mVRA+of0ESyduagH HKTOMJdNwalxkuvXOUgOm3maemb22k/oNrTAKwDl/daNhbE7b0ltcgoiyL0/29ryRTMZ V98b2prNXxRHcidykTG5fZe7QHGlJlpdIIx7n7lLqxKDmSi9mJNUUu/XB8NbSMn6Gv4v GgFg== X-Forwarded-Encrypted: i=1; AJvYcCXAy0axh9WCSRm8kFsuEBNFWZbuX/WeBp8/S8L01zxnfGtJKSPkfWDqd4TrrrcTT4iybmvi2IQyS8tSL+M=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7sPQ3B4ytuG5uD0YuuxApUCirXQsqX7Dk0jAuoSeU83q8Yigq UkAhQa/GQomLoUookwcd+AHwkuCgPAZte3T1Tq+dClwOXtpAmSSo36Js X-Gm-Gg: ATEYQzw3GzEs45hFXdcK81G+R+UvWOQ+tb2pno+kum0kWRRIXmaz5/TXlbjOj0oNaVY pSJBesw2c8fp5kg1jd4E2MRQ4lZTYKR9Ge5uPMuVfCrVSgKb5FIJSDelJa11tb9jzthSRuUeMPT EJ9aH0quMAs98RjOvsTxtGtTDkc/hDgZTvJTOM7WDgLFy95B4xPbfMGA//2LwnjnVWoUY2Oop1V yN6kIYQDw6pVvqRb6UuUveCP8B75mKoYc9EQLlopgRdrVEsjVlkupqpzH3osCPQjr3tlPihSNgo 1Eh1TJiXX+/Y/8Pa66XH6r6v4iU9920AuWY/x+kzva6TV9B7DjEJFsY7iYRLRRJiPldXXanqrJR fOMm5qmnQ9HDMiwdQ1B3xMJnolq4trGMNuULV3ikDVisZ1aO9rxb2YeKfjCyMn3GS9v8z6YQtDa UyxOirsabDAzlzi7iOhm9AsiI20p4d5gqWez9BIKXN9q4JZnZNzwo= X-Received: by 2002:a05:6830:6205:b0:7d4:bca1:1d9d with SMTP id 46e09a7af769-7d7278304camr7232952a34.11.1773052650056; Mon, 09 Mar 2026 03:37:30 -0700 (PDT) Received: from starman.tricat-industries.com ([136.49.86.72]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d755603798sm231247a34.29.2026.03.09.03.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 03:37:29 -0700 (PDT) From: 'wallentx To: linux-f2fs-devel@lists.sourceforge.net Cc: jaegeuk@kernel.org, chao@kernel.org, linux-kernel@vger.kernel.org, wallentx Subject: [RFC PATCH 0/3] f2fs: reduce zoned LFS memory by sharing SIT valid maps Date: Mon, 9 Mar 2026 05:36:57 -0500 Message-ID: <20260309103700.489932-1-william.allentx@gmail.com> X-Mailer: git-send-email 2.53.0 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: wallentx This series reduces SIT-related memory overhead on zoned F2FS. For zoned devices, F2FS operates in LFS mode. In that configuration SSR is not used, IPU is not allowed, and discard defaults to section granularity. That leaves a large amount of per-segment SIT bitmap storage representing segments that are trivially empty or trivially full. The core change lets empty and fully valid segments reuse shared zero/full SIT valid maps, while active or partial segments keep private maps. The series is split as follows: - [1/3] prepare lockless cur_valid_map readers for later pointer replacement - [2/3] introduce shared zero/full SIT valid maps for zoned LFS, keep private maps only for active or partial segments, invalidate scanned SIT metadata pages after mount-time rebuild, and reject checkpoint=disable because its accounting model does not fit the collapsed shared-SIT representation - [3/3] add shared_sit_check/noshared_sit_check to make the remaining CONFIG_F2FS_CHECK_FS mirror overhead optional without changing the default behavior On a test system with 43 HM-SMR zoned volumes (~550 TB total) and CONFIG_F2FS_CHECK_FS=y, static F2FS memory on top of jaegeuk/f2fs dev at 5f04e90eedd0 changed as follows: - current behavior: 58.91 GiB - patch 2: 27.70 GiB - patch 2 + patch 3 with noshared_sit_check: 12.10 GiB The same design has also been exercised for several months on a kernel based on v6.18 on the same host. This series has also been built, booted, and measured on top of jaegeuk/f2fs dev at 5f04e90eedd0. Feedback is especially welcome on: - the 3-way split - the checkpoint=disable restriction in shared-SIT mode - whether shared_sit_check/noshared_sit_check is the right interface for the remaining CHECK_FS mirror cost wallentx (3): f2fs: prepare cur_valid_map for safe lockless access f2fs: reduce zoned LFS memory by sharing SIT valid maps f2fs: add mount option to disable shared SIT mirror checks Documentation/filesystems/f2fs.rst | 11 + fs/f2fs/checkpoint.c | 4 +- fs/f2fs/debug.c | 21 +- fs/f2fs/f2fs.h | 22 ++ fs/f2fs/gc.c | 29 +- fs/f2fs/segment.c | 436 ++++++++++++++++++++++++----- fs/f2fs/segment.h | 31 +- fs/f2fs/super.c | 25 ++ fs/f2fs/sysfs.c | 8 +- 9 files changed, 494 insertions(+), 93 deletions(-) -- 2.53.0