Whamcloud - gitweb
LU-3270 statahead: statahead thread wait for RPCs to finish 63/9663/7
authorLai Siyao <lai.siyao@intel.com>
Sun, 7 Sep 2014 15:09:20 +0000 (11:09 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Sep 2014 19:28:50 +0000 (19:28 +0000)
commit9eba5aee8e06d950fc433434749ccaa6d219e68f
treebf08815f3d955f344a1c48d138483569ee7d1bfc
parent833b670a1915df9bb3cdcd9cd8dcbdb740af994f
LU-3270 statahead: statahead thread wait for RPCs to finish

Statahead thread should wait for inflight stat RPCs to finish in
case statahead RPC callback may access data allocated in statahead
thread context.

ll_sa_entry_fini() should keep old entry if stat RPC is not
finished yet.

Simplify sai refcounting:
* newly allocated sai will hold one refcount, and it will put it
  after starting statahead thread.
* statahead thread holds one refcount.
* agl thread holds one refcount.
* stat process calls do_statahead_enter() which will try to get
  sai, and if it's valid, it will revalidate from statahead cache,
  and put refcount after use.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: I55a4fe66a5f6c04595d3bc84f0cd3750f20e0ee4
Reviewed-on: http://review.whamcloud.com/9663
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd.h
lustre/llite/dcache.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/statahead.c