From a8646f63e4b6f83394fc89bcf0c68172ecc017d1 Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 19 Aug 2005 06:54:36 +0000 Subject: [PATCH] - added more debug client side pipe related stuff --- lustre/include/linux/obd.h | 2 ++ lustre/ldlm/ldlm_lib.c | 9 ++++++++- lustre/osc/osc_request.c | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 767dca1..12569d5 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -364,6 +364,8 @@ struct client_obd { long cl_write_gaps; long cl_write_num; long cl_read_num; + long cl_cache_wait_num; + long cl_cache_wait_sum; }; /* Like a client, with some hangers-on. Keep mc_client_obd first so that we diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 377a482..9fe9095 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -260,6 +260,8 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) cli->cl_write_gaps = 0; cli->cl_write_num = 0; cli->cl_read_num = 0; + cli->cl_cache_wait_num = 0; + cli->cl_cache_wait_sum = 0; if (num_physpages >> (20 - PAGE_SHIFT) <= 128) { /* <= 128 MB */ cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES / 4; @@ -381,13 +383,18 @@ int client_obd_cleanup(struct obd_device *obddev, int flags) class_import_put(cli->cl_import); cli->cl_import = NULL; - if (cli->cl_write_gap_sum) { + if (cli->cl_write_gaps) { CWARN("%s: (write num: %lu, read num: %lu): %lu write gaps: %lu " "av. (usec), %lu total (usec)\n", obddev->obd_name, cli->cl_write_num, cli->cl_read_num, cli->cl_write_gaps, cli->cl_write_gap_sum / cli->cl_write_gaps, cli->cl_write_gap_sum); } + if (cli->cl_cache_wait_num) { + CWARN("%s: cache wait num: %lu, cache wait av. %lu (usec)\n", + obddev->obd_name, cli->cl_cache_wait_num, + cli->cl_cache_wait_sum / cli->cl_cache_wait_num); + } ldlm_put_ref(flags & OBD_OPT_FORCE); RETURN(0); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 2177ac3..57a626b 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1894,6 +1894,10 @@ static int osc_enter_cache(struct client_obd *cli, struct lov_oinfo *loi, do_gettimeofday(&start); l_wait_event(ocw.ocw_waitq, ocw_granted(cli, &ocw), &lwi); do_gettimeofday(&stop); + + cli->cl_cache_wait_num++; + cli->cl_cache_wait_sum += timeval_sub(&stop, &start); + spin_lock(&cli->cl_loi_list_lock); lprocfs_stime_record(&cli->cl_enter_stime, &stop, &start); if (!list_empty(&ocw.ocw_entry)) { -- 1.8.3.1