Whamcloud - gitweb
b=24320 do not fork a new thread in mem pressure
authorVitaly Fertman <vitaly.fertman@oracle.com>
Tue, 21 Dec 2010 13:07:45 +0000 (16:07 +0300)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Wed, 22 Dec 2010 01:16:46 +0000 (04:16 +0300)
i=johann
i=green

we already check for PF_MEMALLOC in ldlm shrinker and pass this flag
to the blocking thread, but a new thread start was still done with
no check for this flag.

lustre/ldlm/ldlm_lockd.c

index b750b1c..f5fc1f8 100644 (file)
@@ -2218,7 +2218,8 @@ static int ldlm_bl_thread_main(void *arg)
 
                         /* Not fatal if racy and have a few too many threads */
                         if (unlikely(busy < blp->blp_max_threads &&
 
                         /* Not fatal if racy and have a few too many threads */
                         if (unlikely(busy < blp->blp_max_threads &&
-                            busy >= cfs_atomic_read(&blp->blp_num_threads)))
+                            busy >= cfs_atomic_read(&blp->blp_num_threads) &&
+                            !blwi->blwi_mem_pressure))
                                 /* discard the return value, we tried */
                                 ldlm_bl_thread_start(blp);
                 } else {
                                 /* discard the return value, we tried */
                                 ldlm_bl_thread_start(blp);
                 } else {