Skip to contentSkip to conversation

mountstats

DISCUSSION Steve French 2 participants 4 messages Aug 8, 2006 – Aug 14, 2006 VFS

lore
Share & tools
lore
#0 lore raw

Why are mountstats per process (e.g. "cat /proc/1/mountstats")?

The only fs which exports these appears to be nfs. Although it is probably a good idea to export them for cases like nfs (and cifs and some clusterfs) by calling show_stats in fs/namespace.c etc. These stats appear to have nothing to do with per-process data and are rather per-superblock.

NFS for example shows:
device localhost:/test-share mounted on /mnt with fstype nfs statvers=1.0
opts:
rw,vers=3,rsize=32768,wsize=32768,acregmin=3,acregmax=60,acdirmin=30,acdirmax=60,hard,proto=tcp,timeo=600,retrans=3,sec=sys age: 2436

       caps:   caps=0x9,wtmult=4096,dtsize=4096,bsize=0,namelen=255
       sec:    flavor=1,pseudoflavor=1
       events: 0 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
       bytes:  0 0 0 0 0 0 0 0
       RPC iostats version: 1.0  p/v: 100003/3 (nfs)
       xprt:   tcp 721 0 2 0 0 6 6 0 6 0
       per-op statistics
               NULL: 1 1 0 44 24 0 0 0
            GETATTR: 1 1 0 100 112 0 0 0
            SETATTR: 0 0 0 0 0 0 0 0
             LOOKUP: 1 1 0 128 116 0 0 0
             ACCESS: 1 1 0 112 120 0 0 0
           READLINK: 0 0 0 0 0 0 0 0
               READ: 0 0 0 0 0 0 0 0
              WRITE: 0 0 0 0 0 0 0 0
             CREATE: 0 0 0 0 0 0 0 0
              MKDIR: 0 0 0 0 0 0 0 0
            SYMLINK: 0 0 0 0 0 0 0 0
              MKNOD: 0 0 0 0 0 0 0 0
             REMOVE: 0 0 0 0 0 0 0 0
              RMDIR: 0 0 0 0 0 0 0 0
             RENAME: 0 0 0 0 0 0 0 0
               LINK: 0 0 0 0 0 0 0 0
            READDIR: 0 0 0 0 0 0 0 0
        READDIRPLUS: 0 0 0 0 0 0 0 0
             FSSTAT: 0 0 0 0 0 0 0 0
             FSINFO: 1 1 0 100 80 0 4 4
           PATHCONF: 0 0 0 0 0 0 0 0
             COMMIT: 0 0 0 0 0 0 0 0

Is there another path (other than read of /proc/<pid>/mounstats) which ends up in s_op->show_stats?

Seems logical to map cifs's /proc/fs/cifs/Stats to this as well as that already does per-mounted share (close enough to per-mount) stats including:

SMBs: 6 Oplock Breaks: 0
Reads: 0 Bytes: 0
Writes: 0 Bytes: 0
Locks: 0 HardLinks: 0 Symlinks: 0
Opens: 0 Closes: 0 Deletes: 0
Mkdirs: 0 Rmdirs: 0
Renames: 0 T2 Renames 0

#1 lore raw
Quoted 1 line · Steve French

Why are mountstats per process (e.g. "cat /proc/1/mountstats")?

Namespaces are per-process, hence so are the per-mountpoint mountstats.

Cheers,
Trond

#2 lore raw
Quoted 14 lines · Trond Myklebust
Quoted 3 lines · Steve French

Why are mountstats per process (e.g. "cat /proc/1/mountstats")?

Namespaces are per-process, hence so are the per-mountpoint mountstats.

Cheers,
Trond

Namespaces are per process but superblocks are not. It could be confusing to some users. Locating these stats [only] in the perprocess information (alongside some truly per-process stats) creates the impression that the stats are those I/Os for that per-process for that mount while the stats displayed are the stats for the superblock (across all processes that have the superblock in the namespace). I realize that it would not really be possible to show per-process/per-mount stats but it seems odd that the per-superblock mountstats show up only here, rather in a more intuitive location(s) such as /proc/mountstats [as well].

#3 lore raw
Quoted 5 lines · Steve French (smfltc)

Namespaces are per process but superblocks are not. It could be confusing to some users. Locating
these stats [only] in the perprocess information (alongside some truly per-process stats) creates
the impression that the stats are those I/Os for that per-process for

Quoted 8 lines

that mount while
the stats displayed are the stats for the superblock (across all processes that have the superblock
in the namespace). I realize that it would not really be possible to show per-process/per-mount stats
but it seems odd that the per-superblock mountstats show up only here, rather in a more intuitive
location(s) such as /proc/mountstats [as well].

I repeat: the stats are _NOT_ per superblock. They are per mountpoint.

Cheers,
Trond