hammer - Remove global VOP counters
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 4 Dec 2016 17:06:25 +0000 (09:06 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 4 Dec 2016 17:09:42 +0000 (09:09 -0800)
* Remove global VOP counters.  These were only used for debugging.
  Removing these globals significantly improves concurrent VOP operations
  on multi-core systems, particularly multi-socket systems, by removing
  a cache ping-pong bottleneck.

Discussed-with: Mateusz Guzik (mjg_)

sbin/hammer/cmd_stats.c
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_vfsops.c
sys/vfs/hammer/hammer_vnops.c

index 552cb61..aaaedff 100644 (file)
@@ -45,7 +45,7 @@ static void loaddelay(struct timespec *ts, const char *arg);
 #define bstats_title   \
 "   lookups   searches    inserts    deletes   elements     splits iterations  rootiters   reciters"
 #define iostats_title  \
-"   f_read   f_write   f_iopsr   f_iopsw    d_read   d_write i_flushes   commits      undo      redo"
+"   f_read   f_write   d_read   d_write i_flushes   commits      undo      redo"
 
 /*
  * Taken from sys/vfs/hammer/hammer_vfsops.c
@@ -65,8 +65,6 @@ struct btree_stats {
 struct io_stats {
        int64_t file_read;
        int64_t file_write;
-       int64_t file_iopsr;
-       int64_t file_iopsw;
        int64_t disk_read;
        int64_t disk_write;
        int64_t inode_flushes;
@@ -106,8 +104,6 @@ collect_iostats(struct io_stats *p)
        /* sysctls must exist, so ignore return values */
        _sysctl(_HAMMER"file_read", &p->file_read);
        _sysctl(_HAMMER"file_write", &p->file_write);
-       _sysctl(_HAMMER"file_iopsr", &p->file_iopsr);
-       _sysctl(_HAMMER"file_iopsw", &p->file_iopsw);
        _sysctl(_HAMMER"disk_read", &p->disk_read);
        _sysctl(_HAMMER"disk_write", &p->disk_write);
        _sysctl(_HAMMER"inode_flushes", &p->inode_flushes);
@@ -137,11 +133,9 @@ static __inline __always_inline
 void
 print_iostats(const struct io_stats *p1, const struct io_stats *p2)
 {
-       printf("%9jd %9jd %9jd %9jd %9jd %9jd %9jd %9jd %9jd %9jd",
+       printf("%9jd %9jd %9jd %9jd %9jd %9jd %9jd %9jd",
                (intmax_t)(p1->file_read - p2->file_read),
                (intmax_t)(p1->file_write - p2->file_write),
-               (intmax_t)(p1->file_iopsr - p2->file_iopsr),
-               (intmax_t)(p1->file_iopsw - p2->file_iopsw),
                (intmax_t)(p1->disk_read - p2->disk_read),
                (intmax_t)(p1->disk_write - p2->disk_write),
                (intmax_t)(p1->inode_flushes - p2->inode_flushes),
index bfd1074..35d7623 100644 (file)
@@ -973,8 +973,6 @@ extern int64_t hammer_stats_btree_root_iterations;
 extern int64_t hammer_stats_record_iterations;
 extern int64_t hammer_stats_file_read;
 extern int64_t hammer_stats_file_write;
-extern int64_t hammer_stats_file_iopsr;
-extern int64_t hammer_stats_file_iopsw;
 extern int64_t hammer_stats_disk_read;
 extern int64_t hammer_stats_disk_write;
 extern int64_t hammer_stats_inode_flushes;
index 1a84842..9d9e6b2 100644 (file)
@@ -73,8 +73,6 @@ int64_t hammer_stats_record_iterations;
 
 int64_t hammer_stats_file_read;
 int64_t hammer_stats_file_write;
-int64_t hammer_stats_file_iopsr;
-int64_t hammer_stats_file_iopsw;
 int64_t hammer_stats_disk_read;
 int64_t hammer_stats_disk_write;
 int64_t hammer_stats_inode_flushes;
@@ -207,10 +205,6 @@ SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_file_read, CTLFLAG_RD,
           &hammer_stats_file_read, 0, "");
 SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_file_write, CTLFLAG_RD,
           &hammer_stats_file_write, 0, "");
-SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_file_iopsr, CTLFLAG_RD,
-          &hammer_stats_file_iopsr, 0, "");
-SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_file_iopsw, CTLFLAG_RD,
-          &hammer_stats_file_iopsw, 0, "");
 SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_disk_read, CTLFLAG_RD,
           &hammer_stats_disk_read, 0, "");
 SYSCTL_QUAD(_vfs_hammer, OID_AUTO, stats_disk_write, CTLFLAG_RD,
index 45b8b41..0b99705 100644 (file)
@@ -841,7 +841,6 @@ hammer_vop_access(struct vop_access_args *ap)
        gid_t gid;
        int error;
 
-       ++hammer_stats_file_iopsr;
        uid = hammer_to_unix_xid(&ip->ino_data.uid);
        gid = hammer_to_unix_xid(&ip->ino_data.gid);
 
@@ -924,7 +923,6 @@ hammer_vop_ncreate(struct vop_ncreate_args *ap)
         */
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        /*
         * Create a new filesystem object of the requested type.  The
@@ -1004,7 +1002,6 @@ hammer_vop_getattr(struct vop_getattr_args *ap)
         * by stat is different from the more involved fsid used in the
         * mount structure.
         */
-       ++hammer_stats_file_iopsr;
        hammer_lock_sh(&ip->lock);
        vap->va_fsid = ip->pfsm->fsid_udev ^ (uint32_t)ip->obj_asof ^
                       (uint32_t)(ip->obj_asof >> 32);
@@ -1126,7 +1123,6 @@ hammer_vop_nresolve(struct vop_nresolve_args *ap)
 
        lwkt_gettoken(&hmp->fs_token);
        hammer_simple_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsr;
 
        for (i = 0; i < nlen; ++i) {
                if (ncp->nc_name[i] == '@' && ncp->nc_name[i+1] == '@') {
@@ -1344,7 +1340,6 @@ hammer_vop_nlookupdotdot(struct vop_nlookupdotdot_args *ap)
        }
 
        hammer_simple_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsr;
 
        ip = hammer_get_inode(&trans, dip, parent_obj_id,
                              asof, parent_obj_localization,
@@ -1397,7 +1392,6 @@ hammer_vop_nlink(struct vop_nlink_args *ap)
         */
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        /*
         * Add the filesystem object to the directory.  Note that neither
@@ -1453,7 +1447,6 @@ hammer_vop_nmkdir(struct vop_nmkdir_args *ap)
         */
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        /*
         * Create a new filesystem object of the requested type.  The
@@ -1530,7 +1523,6 @@ hammer_vop_nmknod(struct vop_nmknod_args *ap)
         */
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        /*
         * Create a new filesystem object of the requested type.  The
@@ -1588,7 +1580,6 @@ hammer_vop_open(struct vop_open_args *ap)
 {
        hammer_inode_t ip;
 
-       ++hammer_stats_file_iopsr;
        ip = VTOI(ap->a_vp);
 
        if ((ap->a_mode & FWRITE) && (ip->flags & HAMMER_INODE_RO))
@@ -1627,7 +1618,6 @@ hammer_vop_readdir(struct vop_readdir_args *ap)
        int r;
        int dtype;
 
-       ++hammer_stats_file_iopsr;
        ip = VTOI(ap->a_vp);
        uio = ap->a_uio;
        saveoff = uio->uio_offset;
@@ -1839,7 +1829,6 @@ hammer_vop_readlink(struct vop_readlink_args *ap)
         * Long version
         */
        hammer_simple_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsr;
        hammer_init_cursor(&trans, &cursor, &ip->cache[1], ip);
 
        /*
@@ -1897,7 +1886,6 @@ hammer_vop_nremove(struct vop_nremove_args *ap)
 
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
        error = hammer_dounlink(&trans, ap->a_nch, ap->a_dvp, ap->a_cred, 0, 0);
        hammer_done_transaction(&trans);
        if (error == 0)
@@ -1955,7 +1943,6 @@ hammer_vop_nrename(struct vop_nrename_args *ap)
 
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        /*
         * Remove tncp from the target directory and then link ip as
@@ -2100,7 +2087,6 @@ hammer_vop_nrmdir(struct vop_nrmdir_args *ap)
 
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
        error = hammer_dounlink(&trans, ap->a_nch, ap->a_dvp, ap->a_cred, 0, 1);
        hammer_done_transaction(&trans);
        if (error == 0)
@@ -2130,7 +2116,6 @@ hammer_vop_markatime(struct vop_markatime_args *ap)
                return (0);
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        ip->ino_data.atime = trans.time;
        hammer_modify_inode(&trans, ip, HAMMER_INODE_ATIME);
@@ -2178,7 +2163,6 @@ hammer_vop_setattr(struct vop_setattr_args *ap)
 
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
        error = 0;
 
        if (vap->va_flags != VNOVAL) {
@@ -2401,7 +2385,6 @@ hammer_vop_nsymlink(struct vop_nsymlink_args *ap)
         */
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
 
        /*
         * Create a new filesystem object of the requested type.  The
@@ -2495,7 +2478,6 @@ hammer_vop_nwhiteout(struct vop_nwhiteout_args *ap)
 
        lwkt_gettoken(&hmp->fs_token);
        hammer_start_transaction(&trans, hmp);
-       ++hammer_stats_file_iopsw;
        error = hammer_dounlink(&trans, ap->a_nch, ap->a_dvp,
                                ap->a_cred, ap->a_flags, -1);
        hammer_done_transaction(&trans);
@@ -2515,7 +2497,6 @@ hammer_vop_ioctl(struct vop_ioctl_args *ap)
        hammer_mount_t hmp = ip->hmp;
        int error;
 
-       ++hammer_stats_file_iopsr;
        lwkt_gettoken(&hmp->fs_token);
        error = hammer_ioctl(ip, ap->a_command, ap->a_data,
                             ap->a_fflag, ap->a_cred);
@@ -2988,7 +2969,6 @@ hammer_vop_bmap(struct vop_bmap_args *ap)
        int     error;
        int     blksize;
 
-       ++hammer_stats_file_iopsr;
        ip = ap->a_vp->v_data;
        hmp = ip->hmp;