From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AA46C19F32 for ; Wed, 5 Mar 2025 14:35:45 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tppqa-0007qI-07; Wed, 05 Mar 2025 14:35:44 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tppqS-0007po-MD for linux-f2fs-devel@lists.sourceforge.net; Wed, 05 Mar 2025 14:35:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=r6GscOsKoUvKxnd5nXVc/2C/QH5NeiXWFIVJAeqPILA=; b=X2hV4u6mhjJ+s9WJ8cmvOH/Eu0 uGdknwXa1BqtJtimJKXiEkJbuslFoGkInEfjEK3givURPaQsIbrwZ77hNC6YXPlJo36/sEqBg90vM xKdCTi4Q9TNUrPd/K5RjIaDO24QnkPzNxR9fOIJCTAlwkedRS1tUF5n6vVA6AZ1StgLE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=r6GscOsKoUvKxnd5nXVc/2C/QH5NeiXWFIVJAeqPILA=; b=N4P5Sqcj2XB6GbspQ8dIx6Y5Gf Z0mAs4vsQiSi1xeB4S3Yd+v9JXiRheNTbcSWtdsP1OXH+rFQPmUhizrKPNzFxEBVWBQQlb3JZ7DEg iOF2op6LB9a9A1XVCU5Zfz58jrNfbF+dKUF/qxTXu+5heMnYrPvvWWN+Kar3EcHGltok=; Received: from nyc.source.kernel.org ([147.75.193.91]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tppqN-0004XF-P7 for linux-f2fs-devel@lists.sourceforge.net; Wed, 05 Mar 2025 14:35:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 500B3A4571A; Wed, 5 Mar 2025 14:29:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66F3BC4CED1; Wed, 5 Mar 2025 14:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741185320; bh=+/POTIBYu3YbxycBA5ufAE7WLG0Xfu9i9jwITjW3woE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AFdsha0E3TTkHFrh6locq319Bxuu3oaoMsKrRFGmfy/6GzfzT2Omi/6LAuuPhOoUR 7nuN17GDWc1onwbWAXeoSSCARVFlJ3gAVT0EGgbR65cFmn7iwEXTabW3XCK827pQFk 2OvbXCV4tP6leP0w9LGHFN6BdPnRfHot7I43kQY5uMZWzy8oCWjBBhHp3Qf4A8rwod D/cTaTg/1LsHXDN/z2+dgTPJ+WGJwPLmW5u5PLmLFF3hdCPbi1GnVgjq4IwSVYQWWO 1BVExHEXc0+xi00u7b0G/CppFbabY5v2YoWv5E9u5kohoIoq0DTFw40gz3yOHROTR1 kTMeFzdi5PkPQ== Date: Wed, 5 Mar 2025 14:35:18 +0000 To: Chao Yu Message-ID: References: <20250304192041.4048741-1-daeho43@gmail.com> <41160b37-16ad-4c12-aad2-1214d87d3df0@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <41160b37-16ad-4c12-aad2-1214d87d3df0@kernel.org> X-Headers-End: 1tppqN-0004XF-P7 Subject: Re: [f2fs-dev] [PATCH] f2fs: subtract current_reserved_blocks from total X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jaegeuk Kim via Linux-f2fs-devel Reply-To: Jaegeuk Kim Cc: Daeho Jeong , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 03/05, Chao Yu wrote: > On 3/5/25 03:20, Daeho Jeong wrote: > > From: Daeho Jeong > > > > current_reserved_blocks is not allowed to utilize. For some zoned > > storage devices, vendors will provide extra space which was used for > > device level GC than specs and we will use this space for filesystem > > level GC. This extra space should not be shown to users, otherwise, > > users will see not standardized size number like 530GB, not 512GB. > > Hi Daeho, > > However, if there are other users e.g. oem or vendor want to use > reserved_blocks and current_reserved_blocks sysfs interface to > reserve space, then, total size will be less than 512GB? > > What do you think of adding a new variable to indicate reserved > space for zoned storage case only? Or, adding a sysfs entry like "carve_out" to determine this? > > Thanks, > > > > > Signed-off-by: Daeho Jeong > > --- > > fs/f2fs/super.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > > index 19b67828ae32..c346dcc2518a 100644 > > --- a/fs/f2fs/super.c > > +++ b/fs/f2fs/super.c > > @@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) > > buf->f_type = F2FS_SUPER_MAGIC; > > buf->f_bsize = sbi->blocksize; > > > > - buf->f_blocks = total_count - start_count; > > - > > spin_lock(&sbi->stat_lock); > > > > + buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks; > > user_block_count = sbi->user_block_count; > > total_valid_node_count = valid_node_count(sbi); > > avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM; > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel 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 560DC15746E for ; Wed, 5 Mar 2025 14:35:20 +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=1741185321; cv=none; b=GJn/DkLh6Z+k5N7yWt9BHU4zjkaYS6FjojlSThnxpcoRUQxVaVpxPSoxXC2a+g+rWItqCz9qB8E2TTiiM+fhzbY4uCLssNFp/jllT8DF5l4gMIoJNmjVRuu5eAAwlpwAdwb/8OC8PAjaUmEximxNNc2fLDHjJK+DRE9+hZ1RnXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741185321; c=relaxed/simple; bh=+/POTIBYu3YbxycBA5ufAE7WLG0Xfu9i9jwITjW3woE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BxAOtPyx3TSuKhOGWY5XE7EtzX7Bszt95P3gQ7xTGuXLeQEao/7BQqb3Rjjvsc7a+dsFcSdbyAPD7e4Ik5Q/BGFqqbX1vwfHLQuhZ6qsWEm5WN4RZ3+dpoQTffWETGfxGYOC3OhGuzQhgkW0j6LEV28ppeB6spJI5DddYNGuFpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AFdsha0E; 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="AFdsha0E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66F3BC4CED1; Wed, 5 Mar 2025 14:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741185320; bh=+/POTIBYu3YbxycBA5ufAE7WLG0Xfu9i9jwITjW3woE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AFdsha0E3TTkHFrh6locq319Bxuu3oaoMsKrRFGmfy/6GzfzT2Omi/6LAuuPhOoUR 7nuN17GDWc1onwbWAXeoSSCARVFlJ3gAVT0EGgbR65cFmn7iwEXTabW3XCK827pQFk 2OvbXCV4tP6leP0w9LGHFN6BdPnRfHot7I43kQY5uMZWzy8oCWjBBhHp3Qf4A8rwod D/cTaTg/1LsHXDN/z2+dgTPJ+WGJwPLmW5u5PLmLFF3hdCPbi1GnVgjq4IwSVYQWWO 1BVExHEXc0+xi00u7b0G/CppFbabY5v2YoWv5E9u5kohoIoq0DTFw40gz3yOHROTR1 kTMeFzdi5PkPQ== Date: Wed, 5 Mar 2025 14:35:18 +0000 From: Jaegeuk Kim To: Chao Yu Cc: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH] f2fs: subtract current_reserved_blocks from total Message-ID: References: <20250304192041.4048741-1-daeho43@gmail.com> <41160b37-16ad-4c12-aad2-1214d87d3df0@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41160b37-16ad-4c12-aad2-1214d87d3df0@kernel.org> On 03/05, Chao Yu wrote: > On 3/5/25 03:20, Daeho Jeong wrote: > > From: Daeho Jeong > > > > current_reserved_blocks is not allowed to utilize. For some zoned > > storage devices, vendors will provide extra space which was used for > > device level GC than specs and we will use this space for filesystem > > level GC. This extra space should not be shown to users, otherwise, > > users will see not standardized size number like 530GB, not 512GB. > > Hi Daeho, > > However, if there are other users e.g. oem or vendor want to use > reserved_blocks and current_reserved_blocks sysfs interface to > reserve space, then, total size will be less than 512GB? > > What do you think of adding a new variable to indicate reserved > space for zoned storage case only? Or, adding a sysfs entry like "carve_out" to determine this? > > Thanks, > > > > > Signed-off-by: Daeho Jeong > > --- > > fs/f2fs/super.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > > index 19b67828ae32..c346dcc2518a 100644 > > --- a/fs/f2fs/super.c > > +++ b/fs/f2fs/super.c > > @@ -1833,10 +1833,9 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf) > > buf->f_type = F2FS_SUPER_MAGIC; > > buf->f_bsize = sbi->blocksize; > > > > - buf->f_blocks = total_count - start_count; > > - > > spin_lock(&sbi->stat_lock); > > > > + buf->f_blocks = total_count - start_count - sbi->current_reserved_blocks; > > user_block_count = sbi->user_block_count; > > total_valid_node_count = valid_node_count(sbi); > > avail_node_count = sbi->total_node_count - F2FS_RESERVED_NODE_NUM; >