All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] f2fs: Do not issue small discards in LFS mode
@ 2017-05-26  8:04 Damien Le Moal
  2017-05-26  8:16   ` Chao Yu
  0 siblings, 1 reply; 6+ messages in thread
From: Damien Le Moal @ 2017-05-26  8:04 UTC (permalink / raw)
  To: linux-f2fs-devel, jaegeuk, yuchao0; +Cc: linux-fsdevel

clear_prefree_segments() issues small discards after discarding full
segments. These small discards may not be section aligned, so not zone
aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
Fix this by not issuing small discards for a volume mounted with the BLKZONED
feature enabled.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 fs/f2fs/segment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 9684585..1279650 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 					sbi->blocks_per_seg, cur_pos);
 			len = next_pos - cur_pos;
 
-			if (force && len < cpc->trim_minlen)
+			if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
+			    (force && len < cpc->trim_minlen))
 				goto skip;
 
 			f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
-- 
2.9.4

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

* Re: [PATCH v2] f2fs: Do not issue small discards in LFS mode
  2017-05-26  8:04 [PATCH v2] f2fs: Do not issue small discards in LFS mode Damien Le Moal
@ 2017-05-26  8:16   ` Chao Yu
  0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-05-26  8:16 UTC (permalink / raw)
  To: Damien Le Moal, linux-f2fs-devel, jaegeuk; +Cc: linux-fsdevel

On 2017/5/26 16:04, Damien Le Moal wrote:
> clear_prefree_segments() issues small discards after discarding full
> segments. These small discards may not be section aligned, so not zone
> aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
> Fix this by not issuing small discards for a volume mounted with the BLKZONED
> feature enabled.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

This version looks good to me.

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

Thanks,

> ---
>  fs/f2fs/segment.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 9684585..1279650 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>  					sbi->blocks_per_seg, cur_pos);
>  			len = next_pos - cur_pos;
>  
> -			if (force && len < cpc->trim_minlen)
> +			if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
> +			    (force && len < cpc->trim_minlen))
>  				goto skip;
>  
>  			f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
> 

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

* Re: [PATCH v2] f2fs: Do not issue small discards in LFS mode
@ 2017-05-26  8:16   ` Chao Yu
  0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-05-26  8:16 UTC (permalink / raw)
  To: Damien Le Moal, linux-f2fs-devel, jaegeuk; +Cc: linux-fsdevel

On 2017/5/26 16:04, Damien Le Moal wrote:
> clear_prefree_segments() issues small discards after discarding full
> segments. These small discards may not be section aligned, so not zone
> aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
> Fix this by not issuing small discards for a volume mounted with the BLKZONED
> feature enabled.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

This version looks good to me.

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

Thanks,

> ---
>  fs/f2fs/segment.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 9684585..1279650 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>  					sbi->blocks_per_seg, cur_pos);
>  			len = next_pos - cur_pos;
>  
> -			if (force && len < cpc->trim_minlen)
> +			if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
> +			    (force && len < cpc->trim_minlen))
>  				goto skip;
>  
>  			f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

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

* Re: [PATCH v2] f2fs: Do not issue small discards in LFS mode
  2017-05-26  8:16   ` Chao Yu
  (?)
@ 2017-07-04  8:11   ` Damien Le Moal
  2017-07-04  9:21     ` Jaegeuk Kim
  -1 siblings, 1 reply; 6+ messages in thread
From: Damien Le Moal @ 2017-07-04  8:11 UTC (permalink / raw)
  To: Chao Yu, linux-f2fs-devel, jaegeuk; +Cc: linux-fsdevel

Jaegeuk,

On 5/26/17 17:16, Chao Yu wrote:
> On 2017/5/26 16:04, Damien Le Moal wrote:
>> clear_prefree_segments() issues small discards after discarding full
>> segments. These small discards may not be section aligned, so not zone
>> aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
>> Fix this by not issuing small discards for a volume mounted with the BLKZONED
>> feature enabled.
>>
>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> 
> This version looks good to me.
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
> 
> Thanks,
> 
>> ---
>>  fs/f2fs/segment.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index 9684585..1279650 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>>  					sbi->blocks_per_seg, cur_pos);
>>  			len = next_pos - cur_pos;
>>  
>> -			if (force && len < cpc->trim_minlen)
>> +			if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
>> +			    (force && len < cpc->trim_minlen))
>>  				goto skip;
>>  
>>  			f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
>>

It looks like this patch was not included in 4.12, so we are still
getting a lot of "unaligned discard" on zoned block devices.
Is there a problem with this patch or was that an oversight ?

Please consider adding this patch.

Best regards.

-- 
Damien Le Moal,
Western Digital

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

* Re: [PATCH v2] f2fs: Do not issue small discards in LFS mode
  2017-07-04  8:11   ` Damien Le Moal
@ 2017-07-04  9:21     ` Jaegeuk Kim
  2017-07-05  1:01       ` Damien Le Moal
  0 siblings, 1 reply; 6+ messages in thread
From: Jaegeuk Kim @ 2017-07-04  9:21 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Chao Yu, linux-f2fs-devel, linux-fsdevel

Hi Damien,

On 07/04, Damien Le Moal wrote:
> Jaegeuk,
> 
> On 5/26/17 17:16, Chao Yu wrote:
> > On 2017/5/26 16:04, Damien Le Moal wrote:
> >> clear_prefree_segments() issues small discards after discarding full
> >> segments. These small discards may not be section aligned, so not zone
> >> aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
> >> Fix this by not issuing small discards for a volume mounted with the BLKZONED
> >> feature enabled.
> >>
> >> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> > 
> > This version looks good to me.
> > 
> > Reviewed-by: Chao Yu <yuchao0@huawei.com>
> > 
> > Thanks,
> > 
> >> ---
> >>  fs/f2fs/segment.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> >> index 9684585..1279650 100644
> >> --- a/fs/f2fs/segment.c
> >> +++ b/fs/f2fs/segment.c
> >> @@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
> >>  					sbi->blocks_per_seg, cur_pos);
> >>  			len = next_pos - cur_pos;
> >>  
> >> -			if (force && len < cpc->trim_minlen)
> >> +			if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
> >> +			    (force && len < cpc->trim_minlen))
> >>  				goto skip;
> >>  
> >>  			f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
> >>
> 
> It looks like this patch was not included in 4.12, so we are still
> getting a lot of "unaligned discard" on zoned block devices.
> Is there a problem with this patch or was that an oversight ?

Ah, I filed the patch towards 4.13-rc1, and marked it to be merged into the
stable kernel for v4.12. I'm planning pull-request this week, so expect it'll be
merged after then.

Thanks,

> 
> Please consider adding this patch.
> 
> Best regards.
> 
> -- 
> Damien Le Moal,
> Western Digital

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

* Re: [PATCH v2] f2fs: Do not issue small discards in LFS mode
  2017-07-04  9:21     ` Jaegeuk Kim
@ 2017-07-05  1:01       ` Damien Le Moal
  0 siblings, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2017-07-05  1:01 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: Chao Yu, linux-f2fs-devel, linux-fsdevel

Jaegeuk,

On 7/4/17 18:21, Jaegeuk Kim wrote:
> Hi Damien,
> 
> On 07/04, Damien Le Moal wrote:
>> Jaegeuk,
>>
>> On 5/26/17 17:16, Chao Yu wrote:
>>> On 2017/5/26 16:04, Damien Le Moal wrote:
>>>> clear_prefree_segments() issues small discards after discarding full
>>>> segments. These small discards may not be section aligned, so not zone
>>>> aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to fail.
>>>> Fix this by not issuing small discards for a volume mounted with the BLKZONED
>>>> feature enabled.
>>>>
>>>> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>>>
>>> This version looks good to me.
>>>
>>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>>>
>>> Thanks,
>>>
>>>> ---
>>>>  fs/f2fs/segment.c | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>>> index 9684585..1279650 100644
>>>> --- a/fs/f2fs/segment.c
>>>> +++ b/fs/f2fs/segment.c
>>>> @@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
>>>>  					sbi->blocks_per_seg, cur_pos);
>>>>  			len = next_pos - cur_pos;
>>>>  
>>>> -			if (force && len < cpc->trim_minlen)
>>>> +			if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
>>>> +			    (force && len < cpc->trim_minlen))
>>>>  				goto skip;
>>>>  
>>>>  			f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
>>>>
>>
>> It looks like this patch was not included in 4.12, so we are still
>> getting a lot of "unaligned discard" on zoned block devices.
>> Is there a problem with this patch or was that an oversight ?
> 
> Ah, I filed the patch towards 4.13-rc1, and marked it to be merged into the
> stable kernel for v4.12. I'm planning pull-request this week, so expect it'll be
> merged after then.

Since it is a bug fix, I thought it would go into 4.12-rc. But with the
cc to stable, we are fine. Thanks !

-- 
Damien Le Moal,
Western Digital

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

end of thread, other threads:[~2017-07-05  1:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26  8:04 [PATCH v2] f2fs: Do not issue small discards in LFS mode Damien Le Moal
2017-05-26  8:16 ` Chao Yu
2017-05-26  8:16   ` Chao Yu
2017-07-04  8:11   ` Damien Le Moal
2017-07-04  9:21     ` Jaegeuk Kim
2017-07-05  1:01       ` Damien Le Moal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.