Whamcloud - gitweb
LU-56 lnet: parse RC ping in event callback
authorLiang Zhen <liang@whamcloud.com>
Tue, 29 May 2012 06:15:39 +0000 (14:15 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 21 Jun 2012 03:05:05 +0000 (23:05 -0400)
commit51a5b4df5bbbf5fd12c73d2722b230e93fe93327
tree30a54372df278af3136340c59db828583b047690
parentb9bad9bd7d1c3271df916ee62091106e3f3c98b7
LU-56 lnet: parse RC ping in event callback

In current LNet, we don't parse router-checker ping in EQ callback,
NI information from remote side is attached on peer and it's parsed
for each sending. This is OK for now but with upcoming SMP
improvements, the global LNET_LOCK is removed and EQ callback and
peer/router are proteced by different locks, which means sink buffer
of RC ping could be in progressing of change when other thread is
reading it in lnet_send(), and get wrong information.

This patch will parse ping information in EQ callback, and store it
in a new member lnet_route_t::lr_downis which is just a integer,
although reader in lnet_send() still don't have lock while reading
it, but it's OK because it's just an integer and reader can
atomically read reliable result even w/o any lock.

It should also be a little faster than original implememtation
because we don't have to parse RC ping, which should be updated
once for many seconds, for each sending.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I5b89fabfd22f22ba171ef63d30da2d32e2788b16
Reviewed-on: http://review.whamcloud.com/2932
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-types.h
lnet/lnet/lib-move.c
lnet/lnet/peer.c
lnet/lnet/router.c
lnet/lnet/router_proc.c