From: Alexander.Boyko Date: Mon, 21 Jul 2014 10:18:23 +0000 (+0400) Subject: LU-5380 at: net AT after connect X-Git-Tag: 2.6.90~27 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=cd8dc58c76b43c5dfa9ec238cc3f4264e9f5f89f LU-5380 at: net AT after connect Once connected, the previously gathered AT statistics is not valid anymore because may reflect other routing, etc. The connect by itself could take a long time due to different reasons (e.g. server was not ready) and net latency got very high (see import_select_connection()) what does not reflect the current situation. Take into account only the current (re-)CONNECT rpc latency. Signed-off-by: Vitaly Fertman Signed-off-by: Alexander Boyko Xyratex-bug-id: MRP-1285 Change-Id: I6edc0e232a92319e7c8535aced28fe1ad3436c54 Reviewed-on: http://review.whamcloud.com/11155 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Liang Zhen Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 505998c..1f9452d 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -281,8 +281,8 @@ int ptlrpc_at_get_net_latency(struct ptlrpc_request *req) } /* Adjust expected network latency */ -static void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req, - unsigned int service_time) +void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req, + unsigned int service_time) { unsigned int nl, oldnl; struct imp_at *at; diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index f7e200d..80ad967 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -868,6 +868,12 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, imp->imp_obd->obd_self_export->exp_connect_data = *ocd; class_export_put(exp); + /* The net statistics after (re-)connect is not valid anymore, + * because may reflect other routing, etc. */ + at_init(&imp->imp_at.iat_net_latency, 0, 0); + ptlrpc_at_adj_net_latency(request, + lustre_msg_get_service_time(request->rq_repmsg)); + obd_import_event(imp->imp_obd, imp, IMP_EVENT_OCD); if (aa->pcaa_initial_connect) { diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index 09f7b47..53f14dc 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -54,6 +54,8 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait); int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc); /* client.c */ +void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req, + unsigned int service_time); struct ptlrpc_bulk_desc *ptlrpc_new_bulk(unsigned npages, unsigned max_brw, unsigned type, unsigned portal); int ptlrpc_request_cache_init(void);