From 94b11d5a7c55f4f6aff918c3b565b74cb18d04fb Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 26 Feb 2019 10:31:53 +0300 Subject: [PATCH] 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" Change-Id: I88f14da24ea64dcc02a9fd1f4a9c03f5771f8fda Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/34328 Tested-by: Jenkins Reviewed-by: Wang Shilong Reviewed-by: Hongchao Zhang Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/quota/qsd_reint.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 1.8.3.1