gfs2: buffered write prefaulting
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 4 May 2022 21:37:30 +0000 (23:37 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 13 May 2022 20:32:52 +0000 (22:32 +0200)
commitfa5dfa645d85910d747f4e0c97f19e5e97d1c270
tree28e84df2c127259d0e317881e1a4c4ceb1698f05
parent324d116c5a5c8204dc00e63f725a3c5ed09afb53
gfs2: buffered write prefaulting

In gfs2_file_buffered_write, to increase the likelihood that all the
user memory we're trying to write will be resident in memory, carry out
the write in chunks and fault in each chunk of user memory before trying
to write it.  Otherwise, some workloads will trigger frequent short
"internal" writes, causing filesystem blocks to be allocated and then
partially deallocated again when writing into holes, which is wasteful
and breaks reservations.

Neither the chunked writes nor any of the short "internal" writes are
user visible.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/file.c