[Devel] [PATCH RHEL8 COMMIT] fuse: don't perform getattr on each write

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 23 11:54:57 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.19
------>
commit 8e971bc7e9e41af723d34c6f04724c30b130a77f
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Fri Apr 23 11:54:56 2021 +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.
    
    https://jira.sw.ru/browse/PSBM-99138
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 fs/fuse/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 441ca24fe356..2efbbe336375 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1559,11 +1559,12 @@ static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	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, file);
 		if (err)
 			return err;
-
+#endif
 		return generic_file_write_iter(iocb, from);
 	}
 


More information about the Devel mailing list