Received: by 10.213.65.68 with SMTP id h4csp3138034imn; Mon, 9 Apr 2018 15:09:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx48FTm1FpmamRQkiGixIB3BojmfljHhDviFwXnGYB6XrFrnnxSf3sKbyg2qm1ds416+95B26 X-Received: by 2002:a17:902:566:: with SMTP id 93-v6mr39376510plf.327.1523311784504; Mon, 09 Apr 2018 15:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523311784; cv=none; d=google.com; s=arc-20160816; b=vDx0FXw8u5+cuGUt5y5srV41fNuofqqJoIUCxyOmplmtb26E+Q0S1cl5JA1WJaUt8J FE6o6OCQL12CzhA3NQrtqgE5kVihFUQi7iDpbitxafyMnbzVCtrXmNf7fG/fvtGHvX2H fsEl0h4uV9s4ytcxHo4OviDAufFyvgIHUzsSQn+tNg61TXjeSynWrUH2/ShiiiNkna7g FjOXtaPvz6WVC2AceItoRVVQ9WMwDshFDhyU0iLamfPbYaZPVKSOm16gNHFXo7JUTf5A Mn62atrlDSDJ1BPzSsBI0ADd8pMhi+m0sLG6HJlsFcDJ8RICn5B5OUEt6nnuj2TSFAW1 RmiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=2YnYn5fBQ9Kx9yy5KsiGLfzNVejKaBotZFtP4qSkv/o=; b=kHAOr+2vQytZmAw4+D36NaXQgS8zCpr56KfEEngEnz4Oqq2EqM1HknhnzT+74z7l61 SFZ3+nwPt49+4AqDq1l9ixGrpGXosMGMEKslVCaifsWdsMLcT8rOlYB5Kef0SUyx4sL5 YfoxQgopC5CJb1MwD10TX7NX3zjcnNrFUwsCb9e3VYmEALX3cQ/U31kgV92GH3h6zIJs ah7GR4Pj3AJKSmS2I8jnC189RCnPg2pSwPH4aeySM9lZCAIsXznouxTfg4Zl7Gt2YjhJ WP44f1va0D45yblfr/B5D8LHLN0BNm9wd1tC+kE/Kd251g3nddPpVSKyRlPPOF5kh6Mg 7u/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ECW49HQW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16si885252pfh.333.2018.04.09.15.09.07; Mon, 09 Apr 2018 15:09:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ECW49HQW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752734AbeDIObz (ORCPT + 99 others); Mon, 9 Apr 2018 10:31:55 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:45557 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751998AbeDIOby (ORCPT ); Mon, 9 Apr 2018 10:31:54 -0400 Received: by mail-pl0-f65.google.com with SMTP id e22-v6so3499869plj.12 for ; Mon, 09 Apr 2018 07:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=2YnYn5fBQ9Kx9yy5KsiGLfzNVejKaBotZFtP4qSkv/o=; b=ECW49HQW66gkZKT802xcbRw6bNJ3Drxmd3cpbxpUCrd8DIAa71ah9vSZOg/8w4YjpO 2SZwELbcilUCLj4Omdsg4UfZLa5gcq/bHVqYw9S5oL8h1rn+nBm8vX0RG5fIgkx9Fe/M itoWGGJM3AbSoq/YzEqvPnGLPagOw706Xw7+CCyPKMHfDne1AX/cvYgCdIR6w/TBVBd3 F0OAMCc/MZwGWn+pFjAXXjm6GKRHqpz5bUy3Bectx89IPr2cbJmyIelPCx6PQXsV6g+g cv5VwSAABn6M8vDz6aAJIIR7HpXs03Wb2kxcPrZ4ba+xQ6vVBUmvLZc9Th+4PpDRvkz7 2M4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2YnYn5fBQ9Kx9yy5KsiGLfzNVejKaBotZFtP4qSkv/o=; b=L3lEU05vAbyVAABgvlFZlXoespYeamqyurv6b4+6eTSl9owNXW1BqsDLuyAewOcorG +DazuydrB7hZwMclBxGW5vWwxaI15Y/FbNVM4HUsXYLPXcZZWtCXaDsz9VV/npSRHrAo fFpIBbMpC487qlNDmptoqpLOK5OCdqixVM5a6nsNkp8GnNSH4J2L15qMZyt7tpS1K+54 Pv1lHcCVjNGHewawWRLDRsMiABiVjk9bJihs/PlCtx1owXJKkO3R1p722BcRpBBXoq8S Ir/Df2zVsjufsxefyKW1dprmifczkcxwbW2/jG2jTfrlowKdEk1UB6U0nvq72EjvHLlW z/Cw== X-Gm-Message-State: ALQs6tBsn4RFslRBcbvByZjqaS2qRMe866rxuqKTzunsZiZwjLAOyPUd PSFY2KcJLBlfh1G23kqm7t7ExA== X-Received: by 2002:a17:902:6786:: with SMTP id g6-v6mr8927601plk.362.1523284313834; Mon, 09 Apr 2018 07:31:53 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id e190sm1192955pfe.171.2018.04.09.07.31.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 07:31:53 -0700 (PDT) From: Jia-Ju Bai To: ccaulfie@redhat.com, teigland@redhat.com Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] fs: dls: lowcomms: Replace GFP_ATOMIC with GFP_KERNEL in receive_from_sock Date: Mon, 9 Apr 2018 22:31:43 +0800 Message-Id: <1523284303-25996-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org receive_from_sock() is never called in atomic context. The call chain ending up at receive_from_sock() is: [1] receive_from_sock() <- process_recv_sockets() process_recv_sockets() is only set as a parameter of INIT_WORK() And receive_from_sock() also calls mutex_lock(), which indicates this function is not called in atomic context. Despite never getting called from atomic context, receive_from_sock() calls alloc_page() with GFP_ATOMIC, which waits busily for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, to avoid busy waiting and improve the possibility of sucessful allocation. This is found by a static analysis tool named DCNS written by myself. And I also manually check it. Signed-off-by: Jia-Ju Bai --- fs/dlm/lowcomms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 4813d0e..2d4e230 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -633,7 +633,7 @@ static int receive_from_sock(struct connection *con) * This doesn't need to be atomic, but I think it should * improve performance if it is. */ - con->rx_page = alloc_page(GFP_ATOMIC); + con->rx_page = alloc_page(GFP_KERNEL); if (con->rx_page == NULL) goto out_resched; cbuf_init(&con->cb, PAGE_SIZE); -- 1.9.1