[RHEL7,COMMIT] fuse: don't perform getattr on each write

Submitted by Konstantin Khorenko on Nov. 5, 2019, 8:36 a.m.


Message ID 201911050836.xA58a6gk016462@finist-ce7.sw.ru
State New
Series "fuse: don't perform getattr on each write"
Headers show

Commit Message

Konstantin Khorenko Nov. 5, 2019, 8:36 a.m.
The commit is pushed to "branch-rh7-3.10.0-1062.4.1.vz7.115.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.4.1.vz7.115.8
commit f434f30ce9b7e1409e3feb3cae097a1af3a771a3
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Tue Nov 5 11:36:05 2019 +0300

    fuse: don't perform getattr on each write
    Mainline version of "fuse: Turn writeback cache on" patch
    (4d99ff8f12eb) added an extra fuse_update_attributes() call. Comparing
    with previous version it leads to additions getattr calls from kernel
    for each write and leads to significant performance degradation.
    According to ANK it is wrong, in fuse mode with enabled write cache
    kernel is responsible for attributes, they should not be invalidated
    and getattr should be called for open()/stat() only.
    This patch fixes vstorage performance degradation.
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
 fs/fuse/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index cfafff050de8..3a3637cddb03 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1560,11 +1560,12 @@  static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
 	loff_t endbyte = 0;
 	if (get_fuse_conn(inode)->writeback_cache) {
+#if 0 /* fixes performance degradation PSBM-99138 /*
 		/* Update size (EOF optimization) and mode (SUID clearing) */
 		err = fuse_update_attributes(mapping->host, NULL, file, NULL);
 		if (err)
 			return err;
 		return generic_file_aio_write(iocb, iov, nr_segs, pos);