public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired
       [not found] <CGME20171107030535epcas1p2094e05ca25eecd2140518cab7a39723d@epcas1p2.samsung.com>
@ 2017-11-07  3:04 ` Fan Li
  2017-11-07  3:40   ` Jaegeuk Kim
  2017-11-07  5:45   ` Chao Yu
  0 siblings, 2 replies; 4+ messages in thread
From: Fan Li @ 2017-11-07  3:04 UTC (permalink / raw)
  To: 'Chao Yu', 'Chao Yu', 'Jaegeuk Kim'
  Cc: linux-kernel, linux-f2fs-devel

In current version, after scan_free_nid_bits, the scan is over if nid_cnt[FREE_NID] != 0.
In most cases, there are still free nids in the free list during the scan, and scan_free_nid_bits
usually can't increase nid_cnt[FREE_NID].
It causes that __build_free_nids is called many times without solving the shortage
of the free nids. This patch fixes that.

Signed-off-by: Fan li <fanofcode.li@samsung.com>
---
 fs/f2fs/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 3d0d1be..5cef118 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2010,7 +2010,7 @@ static void __build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount)
                /* try to find free nids in free_nid_bitmap */
                scan_free_nid_bits(sbi);

-               if (nm_i->nid_cnt[FREE_NID])
+               if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
                        return;
        }

--
2.7.4

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

* Re: [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired
  2017-11-07  3:04 ` [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired Fan Li
@ 2017-11-07  3:40   ` Jaegeuk Kim
  2017-11-07  7:30     ` Fan Li
  2017-11-07  5:45   ` Chao Yu
  1 sibling, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2017-11-07  3:40 UTC (permalink / raw)
  To: Fan Li; +Cc: 'Chao Yu', 'Chao Yu', linux-kernel,
	linux-f2fs-devel

Hi,

I merged this patch after fixing some broken format. Could you please check
your email configuration?

Thanks,

On 11/07, Fan Li wrote:
> In current version, after scan_free_nid_bits, the scan is over if nid_cnt[FREE_NID] != 0.
> In most cases, there are still free nids in the free list during the scan, and scan_free_nid_bits
> usually can't increase nid_cnt[FREE_NID].
> It causes that __build_free_nids is called many times without solving the shortage
> of the free nids. This patch fixes that.
> 
> Signed-off-by: Fan li <fanofcode.li@samsung.com>
> ---
>  fs/f2fs/node.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 3d0d1be..5cef118 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -2010,7 +2010,7 @@ static void __build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount)
>                 /* try to find free nids in free_nid_bitmap */
>                 scan_free_nid_bits(sbi);
> 
> -               if (nm_i->nid_cnt[FREE_NID])
> +               if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
>                         return;
>         }
> 
> --
> 2.7.4

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

* Re: [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired
  2017-11-07  3:04 ` [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired Fan Li
  2017-11-07  3:40   ` Jaegeuk Kim
@ 2017-11-07  5:45   ` Chao Yu
  1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu @ 2017-11-07  5:45 UTC (permalink / raw)
  To: Fan Li, 'Chao Yu', 'Jaegeuk Kim'
  Cc: linux-kernel, linux-f2fs-devel

On 2017/11/7 11:04, Fan Li wrote:
> In current version, after scan_free_nid_bits, the scan is over if nid_cnt[FREE_NID] != 0.
> In most cases, there are still free nids in the free list during the scan, and scan_free_nid_bits
> usually can't increase nid_cnt[FREE_NID].
> It causes that __build_free_nids is called many times without solving the shortage
> of the free nids. This patch fixes that.
> 
> Signed-off-by: Fan li <fanofcode.li@samsung.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> ---
>  fs/f2fs/node.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 3d0d1be..5cef118 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -2010,7 +2010,7 @@ static void __build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount)
>                 /* try to find free nids in free_nid_bitmap */
>                 scan_free_nid_bits(sbi);
> 
> -               if (nm_i->nid_cnt[FREE_NID])
> +               if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
>                         return;
>         }
> 
> --
> 2.7.4
> 
> 
> 

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

* RE: [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired
  2017-11-07  3:40   ` Jaegeuk Kim
@ 2017-11-07  7:30     ` Fan Li
  0 siblings, 0 replies; 4+ messages in thread
From: Fan Li @ 2017-11-07  7:30 UTC (permalink / raw)
  To: 'Jaegeuk Kim'
  Cc: 'Chao Yu', 'Chao Yu', linux-kernel,
	linux-f2fs-devel



> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Tuesday, November 07, 2017 11:41 AM
> To: Fan Li
> Cc: 'Chao Yu'; 'Chao Yu'; linux-kernel@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired
> 
> Hi,
> 
> I merged this patch after fixing some broken format. Could you please check your email configuration?
> 
> Thanks,
> 

Sorry to bother you with so trivial problem, mail configuration is fine, 
but I use a wrong way to copy the text this time, won't happen again.


> On 11/07, Fan Li wrote:
> > In current version, after scan_free_nid_bits, the scan is over if nid_cnt[FREE_NID] != 0.
> > In most cases, there are still free nids in the free list during the
> > scan, and scan_free_nid_bits usually can't increase nid_cnt[FREE_NID].
> > It causes that __build_free_nids is called many times without solving
> > the shortage of the free nids. This patch fixes that.
> >
> > Signed-off-by: Fan li <fanofcode.li@samsung.com>
> > ---
> >  fs/f2fs/node.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 3d0d1be..5cef118
> > 100644
> > --- a/fs/f2fs/node.c
> > +++ b/fs/f2fs/node.c
> > @@ -2010,7 +2010,7 @@ static void __build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount)
> >                 /* try to find free nids in free_nid_bitmap */
> >                 scan_free_nid_bits(sbi);
> >
> > -               if (nm_i->nid_cnt[FREE_NID])
> > +               if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
> >                         return;
> >         }
> >
> > --
> > 2.7.4

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

end of thread, other threads:[~2017-11-07  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20171107030535epcas1p2094e05ca25eecd2140518cab7a39723d@epcas1p2.samsung.com>
2017-11-07  3:04 ` [f2fs-dev] [PATCH] f2fs: keep scanning until enough free nids are acquired Fan Li
2017-11-07  3:40   ` Jaegeuk Kim
2017-11-07  7:30     ` Fan Li
2017-11-07  5:45   ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox