Skip to content

Commit 7c5d187

Browse files
Christoph Hellwigtrondmypd
authored andcommitted
pnfs: force a layout commit when encountering busy segments during recall
Expedite layout recall processing by forcing a layout commit when we see busy segments. Without it the layout recall might have to wait until the VM decided to start writeback for the file, which can introduce long delays. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 3a3908c commit 7c5d187

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

fs/nfs/callback_proc.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,20 @@ static u32 initiate_file_draining(struct nfs_client *clp,
171171
goto out;
172172

173173
ino = lo->plh_inode;
174+
175+
spin_lock(&ino->i_lock);
176+
pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
177+
spin_unlock(&ino->i_lock);
178+
179+
pnfs_layoutcommit_inode(ino, false);
180+
174181
spin_lock(&ino->i_lock);
175182
if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) ||
176183
pnfs_mark_matching_lsegs_invalid(lo, &free_me_list,
177184
&args->cbl_range))
178185
rv = NFS4ERR_DELAY;
179186
else
180187
rv = NFS4ERR_NOMATCHING_LAYOUT;
181-
pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
182188
spin_unlock(&ino->i_lock);
183189
pnfs_free_lseg_list(&free_me_list);
184190
pnfs_put_layout_hdr(lo);

fs/nfs/pnfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@ pnfs_layout_free_bulk_destroy_list(struct list_head *layout_list,
594594
dprintk("%s freeing layout for inode %lu\n", __func__,
595595
lo->plh_inode->i_ino);
596596
inode = lo->plh_inode;
597+
598+
pnfs_layoutcommit_inode(inode, false);
599+
597600
spin_lock(&inode->i_lock);
598601
list_del_init(&lo->plh_bulk_destroy);
599602
lo->plh_block_lgets++; /* permanently block new LAYOUTGETs */

0 commit comments

Comments
 (0)