lkml.org 
[lkml]   [2021]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [f2fs-dev] [PATCH v4] f2fs: introduce fragment allocation mode mount option
> As a per curseg field.
>
> > Maybe, we run into the same race condition issue you told before for
> > fragment_remained_chunk.
> > Could you clarify this more?
>
> e.g.
>
> F2FS_OPTION(sbi).fs_mode = FS_MODE_FRAGMENT_FIXED_BLK
> fragment_chunk_size = 384
> fragment_hole_size = 384
>
> When creating hole:
>
> - f2fs_allocate_data_block
> - __refresh_next_blkoff
> chunk locates in [0, 383] of current segment
> seg->next_blkoff = 384
> sbi->fragment_remained_chunk = 0
> then we will reset sbi->fragment_remained_chunk to 384
> and move seg->next_blkoff forward to 768 (384 + 384)
> - __has_curseg_space() returns false
> - allocate_segment() allocates new current segment
>
> So, for such case that hole may cross two segments, hole size may be truncated
> to left size of previous segment.

First, sbi->fragment_remained_chunk should be seg->fragment_remained_chunk.
I understand what you mean, so you mean we need to take the leftover
"hole" size over to the next segment?
In the example, the leftover hole size will be (384 - (512-384)). Do
you want to take this over to the next segment?

\
 
 \ /
  Last update: 2021-09-04 06:41    [W:1.642 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site