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>
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.