Whamcloud - gitweb
b=24320 do not fork a new thread in mem pressure
authorVitaly Fertman <vitaly.fertman@oracle.com>
Wed, 26 Jan 2011 15:22:15 +0000 (18:22 +0300)
committerAndrew Perepechko <andrew.perepechko@oracle.com>
Wed, 26 Jan 2011 15:43:23 +0000 (18:43 +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 7ae30fe..69121ff 100644 (file)
@@ -2006,7 +2006,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 &&
-                                    busy >= atomic_read(&blp->blp_num_threads)))
+                            busy >= atomic_read(&blp->blp_num_threads) &&
+                            !blwi->blwi_mem_pressure))
                                 /* discard the return value, we tried */
                                 ldlm_bl_thread_start(blp);
                 } else {