|
since the time after cheking the patch of Bugzilla 24320(https://bugzilla.lustre.org/show_bug.cgi?id=24320), I've started to doubt if the patch is enough.
it's because, let's say, all ldlm_bl_xx threads tried to create new threads and failed to do it due to lack of memory. Then next, all ldlm_bl_xx threads will cal try_to_free_pages via the kmalloc, which has failed to allocate slab memory, and finally try_to_free_pages will call _ldlm_bl_to_thread with LDLM_SYNC via shrink_slab(). so, this case can end up in dead-lock situation, all ldlm_bl_xx thread awaits returning of_ldlm_bl_to_threads but thre is no more ldlm_bl_xx thread to handle blocking requests.
So I think we'd better add set/clear PF_MEMALLOC into before/after cfs_kernel_thread/cfs_create_thread to prevent ldlm_bl_xxx threads from calling __ldlm_bl_to_thread().
|