linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to issue small discard in real-time mode discard
@ 2015-02-28  9:23 Chao Yu
  2015-03-02 23:58 ` Changman Lee
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu @ 2015-02-28  9:23 UTC (permalink / raw)
  To: Jaegeuk Kim, Changman Lee; +Cc: linux-f2fs-devel, linux-kernel

Now in f2fs, we share functions and structures for batch mode and real-time mode
discard. For real-time mode discard, in shared function add_discard_addrs, we
will use uninitialized trim_minlen in struct cp_control to compare with length
of contiguous free blocks to decide whether skipping discard fragmented freespace
or not, this makes us ignore small discard sometimes. Fix it.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index daee4ab..fcc1cc2 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -549,7 +549,7 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 
 		end = __find_rev_next_zero_bit(dmap, max_blocks, start + 1);
 
-		if (end - start < cpc->trim_minlen)
+		if (force && end - start < cpc->trim_minlen)
 			continue;
 
 		__add_discard_entry(sbi, cpc, start, end);
-- 
2.3.1



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

* Re: [PATCH] f2fs: fix to issue small discard in real-time mode discard
  2015-02-28  9:23 [PATCH] f2fs: fix to issue small discard in real-time mode discard Chao Yu
@ 2015-03-02 23:58 ` Changman Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Changman Lee @ 2015-03-02 23:58 UTC (permalink / raw)
  To: Chao Yu; +Cc: Jaegeuk Kim, linux-f2fs-devel, linux-kernel

On Sat, Feb 28, 2015 at 05:23:30PM +0800, Chao Yu wrote:
> Now in f2fs, we share functions and structures for batch mode and real-time mode
> discard. For real-time mode discard, in shared function add_discard_addrs, we
> will use uninitialized trim_minlen in struct cp_control to compare with length
> of contiguous free blocks to decide whether skipping discard fragmented freespace
> or not, this makes us ignore small discard sometimes. Fix it.
> 
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
>  fs/f2fs/segment.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index daee4ab..fcc1cc2 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -549,7 +549,7 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>  
>  		end = __find_rev_next_zero_bit(dmap, max_blocks, start + 1);
>  
> -		if (end - start < cpc->trim_minlen)
> +		if (force && end - start < cpc->trim_minlen)
>  			continue;

Reviewed-by : Changman Lee <cm224.lee@samsung.com>

>  
>  		__add_discard_entry(sbi, cpc, start, end);
> -- 
> 2.3.1
> 

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

end of thread, other threads:[~2015-03-02 23:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-28  9:23 [PATCH] f2fs: fix to issue small discard in real-time mode discard Chao Yu
2015-03-02 23:58 ` Changman Lee

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).