linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: increase the limit for reserve_root
@ 2022-08-23 17:21 Jaegeuk Kim
  2022-08-24  2:26 ` Jaegeuk Kim
  2022-09-13  3:15 ` [f2fs-dev] " Chao Yu
  0 siblings, 2 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2022-08-23 17:21 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim

This patch increases the threshold that limits the reserved root space from 0.2%
to 12.5% by using simple shift operation.

Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is
around 64MB becomes too small. Let's relax it.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 09972b709cdd..d1b4de5b4083 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -301,10 +301,10 @@ static void f2fs_destroy_casefold_cache(void) { }
 
 static inline void limit_reserve_root(struct f2fs_sb_info *sbi)
 {
-	block_t limit = min((sbi->user_block_count << 1) / 1000,
+	block_t limit = min((sbi->user_block_count >> 3),
 			sbi->user_block_count - sbi->reserved_blocks);
 
-	/* limit is 0.2% */
+	/* limit is 12.5% */
 	if (test_opt(sbi, RESERVE_ROOT) &&
 			F2FS_OPTION(sbi).root_reserved_blocks > limit) {
 		F2FS_OPTION(sbi).root_reserved_blocks = limit;
-- 
2.37.1.595.g718a3a8f04-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: increase the limit for reserve_root
  2022-08-23 17:21 [PATCH] f2fs: increase the limit for reserve_root Jaegeuk Kim
@ 2022-08-24  2:26 ` Jaegeuk Kim
  2022-09-13  3:15 ` [f2fs-dev] " Chao Yu
  1 sibling, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2022-08-24  2:26 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel

On 08/23, Jaegeuk Kim wrote:
> This patch increases the threshold that limits the reserved root space from 0.2%
> to 12.5% by using simple shift operation.
> 
> Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is
> around 64MB becomes too small. Let's relax it.
> 

Added:

Reported-by: Aran Dalton <arda@allwinnertech.com>

Thanks,

> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/super.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 09972b709cdd..d1b4de5b4083 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -301,10 +301,10 @@ static void f2fs_destroy_casefold_cache(void) { }
>  
>  static inline void limit_reserve_root(struct f2fs_sb_info *sbi)
>  {
> -	block_t limit = min((sbi->user_block_count << 1) / 1000,
> +	block_t limit = min((sbi->user_block_count >> 3),
>  			sbi->user_block_count - sbi->reserved_blocks);
>  
> -	/* limit is 0.2% */
> +	/* limit is 12.5% */
>  	if (test_opt(sbi, RESERVE_ROOT) &&
>  			F2FS_OPTION(sbi).root_reserved_blocks > limit) {
>  		F2FS_OPTION(sbi).root_reserved_blocks = limit;
> -- 
> 2.37.1.595.g718a3a8f04-goog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: increase the limit for reserve_root
  2022-08-23 17:21 [PATCH] f2fs: increase the limit for reserve_root Jaegeuk Kim
  2022-08-24  2:26 ` Jaegeuk Kim
@ 2022-09-13  3:15 ` Chao Yu
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2022-09-13  3:15 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-f2fs-devel

On 2022/8/24 1:21, Jaegeuk Kim wrote:
> This patch increases the threshold that limits the reserved root space from 0.2%
> to 12.5% by using simple shift operation.
> 
> Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is
> around 64MB becomes too small. Let's relax it.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-13  3:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23 17:21 [PATCH] f2fs: increase the limit for reserve_root Jaegeuk Kim
2022-08-24  2:26 ` Jaegeuk Kim
2022-09-13  3:15 ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).