LU-56 obdclass: SMP improvement for lu_key

ptlrpc service threads need to call lu_context_init/fini in each
loop (for each RPC), this could be a big performance issue on
fat SMP machine if we always add lu_context to remember list
because operations on lu_context with LCT_REMEMBER are serialized
by one spinlock and we need to lock/unlock it for multiple times
for each RPC.

But we found LCT_REMEMBER is abused at here, it's impossible that
server stack is being unloaded but service threads are still
running, so we can simply remove LCT_REMEMBER flag from ->rq_session,
and made some small changes to bypass global lock in lu_context_init
and lu_context_fini if w/o LCT_REMEMBER.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I5875a90365a103707526483047ec7628f6964a56
Reviewed-on: http://review.whamcloud.com/2824
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-56 libcfs: CPT affinity workitem scheduler

this patch covered multipled changes:
- flexible APIs for creating WI schedulers
  a) therioticall user can create any number of WI schedulers, each
     scheduler can have its own threads pool
  b) user can create CPT affinity WI schedulers for each CPT, it's
     reserved for LNet selftest.
- rehashing and LNet selftest will not share WI schedulers anymore
- libcfs will only start a WI scheduler with small number of threads
  for cfs_hash rehashing
- LNet selftest will create its own schedulers on starting of module,
  and destroy schedulers on shutting down of module

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Idf66a83817fe847ed29e052e0ddc2a4fed498f1a
Reviewed-on: http://review.whamcloud.com/2729
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1305 osd: index operations for osd-zfs

index insert/delete/lookup, iterator support

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I46819a5dd4da601716e516fb54942aa611497aef
Reviewed-on: http://review.whamcloud.com/2967
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1305 osd: body operations for osd-zfs

read/write, get/put bufs, punch

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ie2ccd127b52b00904ec0ce5ba143466ca0328f95
Reviewed-on: http://review.whamcloud.com/2968
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1396 osc: control the RPC rate between MDS and OST

1. Limit the RPC rate with setting 50 maxim rpc in flight between
MDS and OST.

2. Add specify flag in oa to tell whether the destory from echo_md
destory or MDT close/unlink orphan, where we can not throttle the
destory RPC, since it might block ptlrpcd thread. See Bug 16006.

Signed-off-by: Wang Di <di.wang@whamcloud.com>
Change-Id: Ie3b555eecd2716a82b058f645d002f46d8c4dd36
Reviewed-on: http://review.whamcloud.com/2899
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1305 osd: xattr support for osd-zfs

xattr set/get/list, including SA

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ifae82853911a1891ad4b3e6e127e29f6d83bba7b
Reviewed-on: http://review.whamcloud.com/2969
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1182 quota: quota accounting library

Library functions for quota accounting.
Introduce basic support for Quota Slave Driver (aka QSD) which just
registers procfs file to dump the accounting data for the time being.

Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Change-Id: I35495062b82f43f2bc26c263e08a656f9cbd9c2b
Reviewed-on: http://review.whamcloud.com/3147
Tested-by: Hudson
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-56 ptlrpc: Reduce at_lock dance

Some lock dances of service at_lock are unnecessary,
we made some cleanup in this patch to reduce useless lock/unlock.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I004729692254d1200a8b18c0c4494ff437233caf
Reviewed-on: http://review.whamcloud.com/2911
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>