2004-04-17 19:46:05

by Lever, Charles

[permalink] [raw]
Subject: RFC: adding an "fs" directory under /sys

i've been working on a patch set that will expose I/O counters
for NFS mount points. we're considering exposing these counters
via /sys.

i'm thinking this should go under /sys/fs, where there is one
subdirectory in /sys/fs for each file system type available
on the system.

the patches are against 2.6.5.

attached patch 04-sys-fs adds the mechanicals to allow each
file system implementation to supply a subsystem structure
that can be registered in /sys/fs when the file system
registers with the kernel at module load / boot time.

attached patch 05-sys-fs-nfs demonstrates what might be done
with such a capability by providing specific attributes for
each NFS mount point.

attached patch 06-nfs-iostat implements NFS I/O statistics
counters and exports them via /sys/fs.

[ patch 07-rpc-metrics, not yet written, would extend this
idea to include RPC client I/O statistics for each mount point ]

i'd like some comments on this approach.

1. is it a good and appropriate usage of /sys to add an
fs/ subdirectory for file system types?

2. i've used the kobject embedded in the super_block
for the NFS specific pieces of this. should i instead
add and use an embedded kobject in the nfs_server
struct?

3. would it be better to have a /sys/mount kset that lists
all the mounts on the system, and leave file system
instance related info out of /sys/fs/<file-type> ?

- Chuck Lever
--
corporate: <cel at netapp dot com>
personal: <chucklever at bigfoot dot com>


Attachments:
04-sys-fs.patch (3.16 kB)
04-sys-fs.patch
05-sys-fs-nfs.patch (20.30 kB)
05-sys-fs-nfs.patch
06-nfs-iostat.patch (14.54 kB)
06-nfs-iostat.patch
Download all attachments

2004-04-17 20:07:40

by Al Viro

[permalink] [raw]
Subject: Re: RFC: adding an "fs" directory under /sys

On Sat, Apr 17, 2004 at 12:46:05PM -0700, Lever, Charles wrote:
> i've been working on a patch set that will expose I/O counters
> for NFS mount points. we're considering exposing these counters
> via /sys.
>
> i'm thinking this should go under /sys/fs, where there is one
> subdirectory in /sys/fs for each file system type available
> on the system.

Hell, *no*. Goddamnit, people, just how many times should that story repeat
itself before it sinks into your skulls - DO NOT MESS WITH KOBJECTS UNLESS
YOU UNDERSTAND LIFETIME RULES.

Linus, please consider that as a formal veto on any patches embedding
kobjects into struct super_block unless they are accompanied by detailed
analysis of lifetime rules _AND_ had been reviewed and ACKed on linux-kernel
and linux-fsdevel.