From patchwork Tue Oct 27 15:47:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: saurabh X-Patchwork-Id: 7497531 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 60FEF9F36A for ; Tue, 27 Oct 2015 15:48:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 889E520866 for ; Tue, 27 Oct 2015 15:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACD7220862 for ; Tue, 27 Oct 2015 15:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964914AbbJ0Prx (ORCPT ); Tue, 27 Oct 2015 11:47:53 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36786 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964838AbbJ0Prv (ORCPT ); Tue, 27 Oct 2015 11:47:51 -0400 Received: by pacik9 with SMTP id ik9so25099211pac.3; Tue, 27 Oct 2015 08:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Kva7hEPQWS9YIXqaIaCghpO8Le62Vwh9SXZ5DhXHhtU=; b=W6RwRWMnargm+GZ/CsKbuZL4n20BjshexNRf9W5z3VM4Anu0jNv+tCYl/Bgne+n22K ZdllWcdz7S3xXOpO3OnS3QySJuEN3BQLjZrdjNwedaX5GDL4gmaUVyEPvhBKB/8Xh08i G0Z47CPPKaijJeXwMGklyKYy6Uzb82One08+mxHJRgEdmj6gKC+IgHjTTdrEjN5mJfeY 7R8c0IyCIZjTKqEvejT2GOmTeLxPY1yD1NmlRLFw0gO3LQKQMFGGhXLTvezExBJeblrF Zxr8gQWNCUgbwJ+0lpt6YRi17h8TEWnUtYlqlgrtfCAZD+f+XgwxHK6wFL0nkLEeoCc/ ZZyw== X-Received: by 10.66.151.203 with SMTP id us11mr48190882pab.54.1445960869514; Tue, 27 Oct 2015 08:47:49 -0700 (PDT) Received: from localhost.localdomain ([122.175.75.225]) by smtp.gmail.com with ESMTPSA id ez1sm18059975pab.6.2015.10.27.08.47.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Oct 2015 08:47:49 -0700 (PDT) From: Saurabh Sengar To: dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, ira.weiny@intel.com, jgunthorpe@obsidianresearch.com, yun.wang@profitbricks.com, kaike.wan@intel.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Sengar Subject: [PATCH] IB/sa: replace GFP_KERNEL with GFP_ATOMIC Date: Tue, 27 Oct 2015 21:17:40 +0530 Message-Id: <1445960860-3396-1-git-send-email-saurabh.truth@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP replace GFP_KERNEL with GFP_ATOMIC, as code while holding a spinlock should be atomic GFP_KERNEL may sleep and can cause deadlock, where as GFP_ATOMIC may fail but certainly avoids deadlock Signed-off-by: Saurabh Sengar --- drivers/infiniband/core/sa_query.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 8c014b3..cd1f911 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c @@ -526,7 +526,7 @@ static int ib_nl_send_msg(struct ib_sa_query *query) if (len <= 0) return -EMSGSIZE; - skb = nlmsg_new(len, GFP_KERNEL); + skb = nlmsg_new(len, GFP_ATOMIC); if (!skb) return -ENOMEM; @@ -544,7 +544,7 @@ static int ib_nl_send_msg(struct ib_sa_query *query) /* Repair the nlmsg header length */ nlmsg_end(skb, nlh); - ret = ibnl_multicast(skb, nlh, RDMA_NL_GROUP_LS, GFP_KERNEL); + ret = ibnl_multicast(skb, nlh, RDMA_NL_GROUP_LS, GFP_ATOMIC); if (!ret) ret = len; else