Skip to content

Commit a694291

Browse files
committed
nilfs2: separate wait function from nilfs_segctor_write
This separates wait function for submitted logs from the write function nilfs_segctor_write(). A new list of segment buffers "sc_write_logs" is added to hold logs under writing, and double buffering is partially applied to hide io latency. At this point, the double buffering is disabled for blocksize < pagesize because page dirty flag is turned off during write and dirty buffers are not properly collected for pages crossing over segments. To receive full benefit of the double buffering, further refinement is needed to move the io wait outside the lock section of log writer. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1 parent e29df39 commit a694291

4 files changed

Lines changed: 165 additions & 95 deletions

File tree

‎fs/nilfs2/segbuf.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,22 @@ void nilfs_segbuf_map(struct nilfs_segment_buffer *segbuf, __u64 segnum,
100100
segbuf->sb_fseg_end - segbuf->sb_pseg_start + 1;
101101
}
102102

103+
/**
104+
* nilfs_segbuf_map_cont - map a new log behind a given log
105+
* @segbuf: new segment buffer
106+
* @prev: segment buffer containing a log to be continued
107+
*/
108+
void nilfs_segbuf_map_cont(struct nilfs_segment_buffer *segbuf,
109+
struct nilfs_segment_buffer *prev)
110+
{
111+
segbuf->sb_segnum = prev->sb_segnum;
112+
segbuf->sb_fseg_start = prev->sb_fseg_start;
113+
segbuf->sb_fseg_end = prev->sb_fseg_end;
114+
segbuf->sb_pseg_start = prev->sb_pseg_start + prev->sb_sum.nblocks;
115+
segbuf->sb_rest_blocks =
116+
segbuf->sb_fseg_end - segbuf->sb_pseg_start + 1;
117+
}
118+
103119
void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *segbuf,
104120
__u64 nextnum, struct the_nilfs *nilfs)
105121
{

‎fs/nilfs2/segbuf.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ struct nilfs_segment_buffer *nilfs_segbuf_new(struct super_block *);
128128
void nilfs_segbuf_free(struct nilfs_segment_buffer *);
129129
void nilfs_segbuf_map(struct nilfs_segment_buffer *, __u64, unsigned long,
130130
struct the_nilfs *);
131+
void nilfs_segbuf_map_cont(struct nilfs_segment_buffer *segbuf,
132+
struct nilfs_segment_buffer *prev);
131133
void nilfs_segbuf_set_next_segnum(struct nilfs_segment_buffer *, __u64,
132134
struct the_nilfs *);
133135
int nilfs_segbuf_reset(struct nilfs_segment_buffer *, unsigned, time_t);

0 commit comments

Comments
 (0)