From: Alex Zhuravlev Date: Tue, 26 Feb 2019 07:31:53 +0000 (+0300) Subject: LU-12018 quota: do not start a thread under memory pressure X-Git-Tag: 2.12.1-RC1~65 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=87cc5662ebf3c2ea3b5c1630bddba2b6c4ec8c52;p=fs%2Flustre-release.git LU-12018 quota: do not start a thread under memory pressure this leads to a deadlock as kthreadd creating new threads can get stuck waiting for memory as well: PID: 2 TASK: ffff88015d1e0fb0 CPU: 3 COMMAND: "kthreadd" Lustre-change: https://review.whamcloud.com/34328 Lustre-commit: 94b11d5a7c55f4f6aff918c3b565b74cb18d04fb Change-Id: I88f14da24ea64dcc02a9fd1f4a9c03f5771f8fda Signed-off-by: Alex Zhuravlev Reviewed-by: Wang Shilong Reviewed-by: Hongchao Zhang Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/34464 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/quota/qsd_reint.c b/lustre/quota/qsd_reint.c index a74d9f5..fb90ca1 100644 --- a/lustre/quota/qsd_reint.c +++ b/lustre/quota/qsd_reint.c @@ -639,6 +639,10 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi) char *name; ENTRY; + /* do not try to start a new thread as this can lead to a deadlock */ + if (current->flags & (PF_MEMALLOC | PF_KSWAPD)) + RETURN(0); + if (qsd->qsd_dev->dd_rdonly) RETURN(0);