From df90dfc9d8b07be12be6e9bed11390dfa0eee6a0 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 17 Jul 2003 07:58:01 +0000 Subject: [PATCH] Landing statfs cache code. - preliminary for prealloc (bug 974) - preliminary for QOS (bug 855) - speeds up parallel df - speeds up lprocfs Lprocfs underwent a bunch of cleanup (mostly from Intel, partly from me) to remove lots of macros and strangeness w.r.t. per-target statfs values. Still open for discussion is how old the cached statfs values can be. I arbitrarily picked 1 second for client statfs, lprocfs, and target statfs caches. We may want to change that, or allow it to be tunable. Note that this code is different than that in bug 855, in that the max_age parameter is an absolute age in jiffies, whereas the patch in bug 855 used a relative time in seconds. The thing I'm trying to avoid is if we say "I want a result up to 1 second old", but we get delayed during an RPC and we don't know what "1 second old" is related to. --- lustre/lov/lov_internal.h | 14 ++++++++++++++ lustre/obdfilter/filter_io.c | 20 ++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index cad14ee..f3bc191 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -7,6 +7,20 @@ * See the file COPYING in this distribution */ +/* lov_obd.c */ int lov_get_stripecnt(struct lov_obd *lov, int stripe_count); int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count); void lov_free_memmd(struct lov_stripe_md **lsmp); + +/* lov_pack.c */ +int lov_packmd(struct lustre_handle *conn, struct lov_mds_md **lmm, + struct lov_stripe_md *lsm); +int lov_unpackmd(struct lustre_handle *conn, struct lov_stripe_md **lsm, + struct lov_mds_md *lmm, int lmmsize); +int lov_setstripe(struct lustre_handle *conn, + struct lov_stripe_md **lsmp, struct lov_mds_md *lmmu); +int lov_getstripe(struct lustre_handle *conn, + struct lov_stripe_md *lsm, struct lov_mds_md *lmmu); + +/* lproc_lov.c */ +extern struct file_operations lov_proc_target_fops; diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 9d66e1c..17f4506 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -659,8 +659,9 @@ int filter_commitrw(int cmd, struct obd_export *exp, struct obdo *oa, } if (time_after(jiffies, lnb->start + 15 * HZ)) - CERROR("slow commitrw %lus\n", - (jiffies - lnb->start) / HZ); + CERROR("slow commitrw %lusi (%lus)\n", + (jiffies - lnb->start) / HZ, + (jiffies - now) / HZ); if (cmd & OBD_BRW_WRITE) { int err = filter_commit_write(lnb, 0); @@ -673,8 +674,9 @@ int filter_commitrw(int cmd, struct obd_export *exp, struct obdo *oa, f_dput(lnb->dentry); if (time_after(jiffies, lnb->start + 15 * HZ)) - CERROR("slow commit_write %lus\n", - (jiffies - lnb->start) / HZ); + CERROR("slow commit_write %lus (%lus)\n", + (jiffies - lnb->start) / HZ, + (jiffies - now) / HZ); } /* FIXME: MULTI OBJECT BRW */ @@ -699,8 +701,9 @@ int filter_commitrw(int cmd, struct obd_export *exp, struct obdo *oa, continue; if (time_after(jiffies, lnb->start + 15 * HZ)) - CERROR("slow commitrw locked %lus\n", - (jiffies - lnb->start) / HZ); + CERROR("slow commitrw locked %lus (%lus)\n", + (jiffies - lnb->start) / HZ, + (jiffies - now) / HZ); err = filter_write_locked_page(lnb); if (!rc) @@ -709,8 +712,9 @@ int filter_commitrw(int cmd, struct obd_export *exp, struct obdo *oa, found_locked--; if (time_after(jiffies, lnb->start + 15 * HZ)) - CERROR("slow commit_write locked %lus\n", - (jiffies - lnb->start) / HZ); + CERROR("slow commit_write locked %lus (%lus)\n", + (jiffies - lnb->start) / HZ, + (jiffies - now) / HZ); } } -- 1.8.3.1