Whamcloud - gitweb
LU-56 lnet: allow to create EQ with zero eq_size
authorLiang Zhen <liang@whamcloud.com>
Mon, 28 May 2012 03:16:49 +0000 (11:16 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 11 Jun 2012 13:12:11 +0000 (09:12 -0400)
commita096d858b671f28fd4c5e6197b51643cd0780a50
tree4d097f8951cbe992e280e9c6ffb26c66794c0cd7
parentc1366da8f43ecfb98ef3bdcf629eec8a2fc9cd4c
LU-56 lnet: allow to create EQ with zero eq_size

Current LNet doesn't allow to create EQ with zero eq_size, it's
an unnecessary limit if the EQ has callback, because EQ callback
is guaranteed to get every event. EQ with no-zero eq_size is only
useful for LNetEQPoll, there is no Lustre use-case that is using
both EQ callback and LNetEQPoll on a same EQ.

Also, even with upcoming LNet SMP improvements, there has to be
a lock to protect enqueue/dequeue operations of event, which might
hurt performance because of lock contention.

This patch will allow user to create EQ with eq_size being zero,
which means events will only be delivered by callback and user
will get nothing by calling LNetEQPoll.

In multiple thread environment, we would suggest user to create EQ
only with callback (eq_size=0) if the EQ might get high rate events,
LNetEQPoll can still work fine if eq_size is non-zero and nothing
will be changed at all. User is still able to create EQ with both
callback and non-zero eq_size, and call LNetEQPoll to get event,
although it's deprecated.

Summary: still can support all current use-cases, although set
eq_size to zero and only rely on callback will be the better way.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Ia984f2f65eb5fd064a36dfd7b399e46378013c57
Reviewed-on: http://review.whamcloud.com/2925
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: Oleg Drokin <green@whamcloud.com>
lnet/lnet/lib-eq.c
lnet/lnet/router.c
lnet/selftest/rpc.c
lustre/ptlrpc/events.c