mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-09-15 13:50:11 +03:00
Linux: zfs_putpage: complete async page writeback immediately
For async page writeback, we do not need to wait for the page to be on disk before returning to the caller; it's enough that the data from the dirty page be on the DMU and in the in-memory ZIL, just like any other write. So, if this is not a syncing write, don't add a callback to the itx, and instead just unlock the page immediately. (This is effectively the same concept used for FreeBSD in d323fbf49c). Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17584 Closes #14290
This commit is contained in:
parent
f72226a75c
commit
b9c45fe68c
@ -3682,16 +3682,7 @@ top:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
zfs_putpage_sync_commit_cb(void *arg)
|
zfs_putpage_commit_cb(void *arg)
|
||||||
{
|
|
||||||
struct page *pp = arg;
|
|
||||||
|
|
||||||
ClearPageError(pp);
|
|
||||||
end_page_writeback(pp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
zfs_putpage_async_commit_cb(void *arg)
|
|
||||||
{
|
{
|
||||||
struct page *pp = arg;
|
struct page *pp = arg;
|
||||||
|
|
||||||
@ -3895,8 +3886,12 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, pgoff, pglen, commit,
|
zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, pgoff, pglen, commit,
|
||||||
B_FALSE, for_sync ? zfs_putpage_sync_commit_cb :
|
B_FALSE, for_sync ? zfs_putpage_commit_cb : NULL, pp);
|
||||||
zfs_putpage_async_commit_cb, pp);
|
|
||||||
|
if (!for_sync) {
|
||||||
|
ClearPageError(pp);
|
||||||
|
end_page_writeback(pp);
|
||||||
|
}
|
||||||
|
|
||||||
dmu_tx_commit(tx);
|
dmu_tx_commit(tx);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user