Whamcloud - gitweb
LU-7888 obdclass: not hold global lock when lwp callback 34/19034/5
authorFan Yong <fan.yong@intel.com>
Wed, 13 Apr 2016 09:37:18 +0000 (17:37 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 16 May 2016 16:47:56 +0000 (16:47 +0000)
commitbccfc65d04dbd59bedb5dc1509bbdc732fc09b53
tree32bf3d547227ee9435bda306f307fd2e01e486db
parent1929bfe81379a9c986bfa4202265f76d201a49bc
LU-7888 obdclass: not hold global lock when lwp callback

Originally, the lwp_notify_main() thread handled the every
registered lwp callback in turn with holding the global
lwp_register_list_lock. Because some lwp callback, such as
mdt_register_lwp_callback() may be blocked, then it will
cause others to be blocked when try to obtain such lock for
lustre_register_lwp_item(), and then block the mount.

This patch introduces reference count on the lwp_register_item
that will prevent the lwp item being freed during the callback,
so allow the lwp_notify_main() thread to do the real callback
without holding the global lock lwp_register_list_lock.

Intel-bug-Id: LDEV-323

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I1061205d5781e0699478d293e223567a0ebea286
Reviewed-on: http://review.whamcloud.com/19034
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_class.h
lustre/obdclass/obd_mount_server.c