From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F94A53A4 for ; Mon, 28 Feb 2022 11:39:35 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id j17so15027509wrc.0 for ; Mon, 28 Feb 2022 03:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/wlzIgcPfmWlzG8mZw8mU98HRU6UG4iDulaqC27k8XE=; b=HaWNuoLURtPmskYk3JMn81nh3G+CEz3F1Cb6avefJRfg7bdzYCv0GQKlYd01uf1icx ebYnR976irKAf+AiZ88Hy85/ZhE/9numO00I1Nq1PbXHsrTpJ0PUn1lh9tmaLzUbOchs xrIUDA4n5tRz8t/MhjFjEmnni4Jg3DeKqZ+GIAbNEfbUqfJ4DNGAJDERCfixc0ba55OX EcMYlns3XqGLd7TQsJCQGlUz9d7wHnRuZE6bzo4cstColw0lQnaoW8N2nZ33xUxye/fU OIyRC1Kufdq/kwwjy7Mr4zqMuAM58/571xa7kVUKcMy1lRCN7IhfbqvIqZtyNzu71vDh dCOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/wlzIgcPfmWlzG8mZw8mU98HRU6UG4iDulaqC27k8XE=; b=Mks/t5nBMrE/Q+5EFWPEFs8TzbCWyAH7cCEsd1kDdWSR4ayknQ7PqX9nJTkkVa/E9J MBWPcfFmU0kDYhGYejUST8HnVQE/z8TIhE+ySKJkBtVp/02oXEPjIR60BtdMSdJ8e6o8 N0HzyY2h7GGU0UZgK6Y7bvOtpcEyG2oc+PTSK7MRJRRtLVzthr2EeWxc8bc55boAg+Fh cYUtihAG1ZCat75iobf/i3ks3cjndLMwnXuMWNitnYdBlhULN6S8t4Svtv7ueg2rhDY6 TXw3C4/4/ap4yOHIRX54sCMEr5vVDy4sG4QpoaqJlyVgsbM2mlHXx08x9VSIAcIpcFB9 7rVA== X-Gm-Message-State: AOAM531/hJ9PxKudhxQbiqHvEJMWN7M7Rp0yg8MbscOArK/9Jg2o1Ed3 lOxliqnGNY12vXEZqERyCsQ= X-Google-Smtp-Source: ABdhPJx3/58BLQbW37CqO1FcM0VcammSp/oCUcSsL3jYD3As8LSPNJ9Se3sgmxWJkzo6qkIg/DhlVA== X-Received: by 2002:a5d:47ae:0:b0:1ef:d725:876e with SMTP id 14-20020a5d47ae000000b001efd725876emr2777714wrb.447.1646048373450; Mon, 28 Feb 2022 03:39:33 -0800 (PST) Received: from localhost.localdomain ([5.29.13.154]) by smtp.gmail.com with ESMTPSA id e22-20020adf9bd6000000b001eda1017861sm10584592wrc.64.2022.02.28.03.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 03:39:33 -0800 (PST) From: Amir Goldstein To: Miklos Szeredi Cc: Al Viro , linux-unionfs@vger.kernel.org, containers@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 6/6] fuse: opt-in for per-mount io stats Date: Mon, 28 Feb 2022 13:39:10 +0200 Message-Id: <20220228113910.1727819-7-amir73il@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220228113910.1727819-1-amir73il@gmail.com> References: <20220228113910.1727819-1-amir73il@gmail.com> Precedence: bulk X-Mailing-List: containers@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Traditionally, system administrators have used the iostat utility to track the amount of io performed to a local disk filesystem. Similar functionality is provided for NFS mounts via the nfsstat utility that reads the NFS client's stats from /proc/pid/mountstats. There is currently no good way for a system administrator or a monitoring application to track the amount of io performed via fuse filesystems. Opt-in for generic io stats via /proc/pid/mountstats to provide that functionality. It is possible to collect io stats on the server side inside libfuse, but those io stats will not cover cached writes and reads. Therefore, implementing the server side io stats would be complementary to these client side io stats. Also, this feature provides the io stats for existing fuse filesystem/lib release binaries. This feature depends on CONFIG_MOUNT_IO_STATS. Signed-off-by: Amir Goldstein --- fs/fuse/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 9ee36aa73251..5c58583a12fc 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1806,7 +1806,7 @@ static void fuse_kill_sb_anon(struct super_block *sb) static struct file_system_type fuse_fs_type = { .owner = THIS_MODULE, .name = "fuse", - .fs_flags = FS_HAS_SUBTYPE | FS_USERNS_MOUNT, + .fs_flags = FS_HAS_SUBTYPE | FS_USERNS_MOUNT | FS_MOUNT_STATS, .init_fs_context = fuse_init_fs_context, .parameters = fuse_fs_parameters, .kill_sb = fuse_kill_sb_anon, -- 2.25.1