Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7147469ybi; Mon, 8 Jul 2019 15:35:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXhgLYsf3HY6BGekNWCU/u1vZvi+dUXcLoo5Voz+gRe8fkPM6IX7oAbBM8gLAL3ZNXGEsm X-Received: by 2002:a63:4e58:: with SMTP id o24mr25917800pgl.366.1562625340051; Mon, 08 Jul 2019 15:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625340; cv=none; d=google.com; s=arc-20160816; b=iIPzLQgv76guRnt5+N9eV8oGxooeAHpRvCXvA218aFfAoNKtIQlu9hQYQ1OhUJTR1m n5neASZYBHVd5kxi+nZ4g293+mDxCbZC4Ym5OYzl2mhiFLMwh2GoS+6g6r/LXxxVnZzJ Pmt/R35jIVBuYE1c2MCH86+W6LN8NQbrhLj9x6oEQmgb+Wut7J0ZOxEOkYVw+pK6up30 V25ewmq6/agbUFqZ+0i1e7oqPs+9LimTcazMa/FN76B56xFF8XrcF0WsIL7c3m5KU7Ky 3BxB18BAZ5qcLSbqz6AwvtumGF+qKo/H2MJWRMWdPyJJVQynQWtEV0jzK3d/c4vhuy9v G19g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ys9AycNH2hbVRf3Y/88ouL+69I1CcBvV+JkneysXraU=; b=qSjHATuBbzbL0uh8/bTgbEde0B76h2vDkh/icXk7S/J0IOKSjHP/mi1/aP6It4E7Tc 60vgY8cCQMfog2VeidzajvR/wk1BRI2CjUecp1U2Twe3yDugI3AHAgO/XE308tKUsA5t ccRBZTplEgZV8I/T1GowYTEvtiq8yedO6ZBrA7i5l2UmZeCv2yu5MP1n1Poqc0lutJZ6 K0txW/eX8AYd4545XzBFs4KuGMUcBhazUrC44S2DE2Aik791h7AnOkylqHqUTn4LSreG WjZ2O/vaNyxwRCHsVpgDgSEsJe1LWVMLq4aqqbINo3EbrqumsJrdV7+yUcwrgJtJebKO 0W5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j8SKIave; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si743522pjp.57.2019.07.08.15.35.25; Mon, 08 Jul 2019 15:35:40 -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=@kernel.org header.s=default header.b=j8SKIave; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387481AbfGHPUZ (ORCPT + 99 others); Mon, 8 Jul 2019 11:20:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:45226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387451AbfGHPUX (ORCPT ); Mon, 8 Jul 2019 11:20:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6725B216FD; Mon, 8 Jul 2019 15:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599221; bh=llOhldVfBQaIDrwlm5N45xRxijHQV8PlwH5Ki7ASyEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8SKIaveVN1ZsVuJEVaQpiJwTUolUG+sWJFiouoys/azVh1cOHCW8fPCv4NeAjQra MdyoqwVNpEdNpUg8IbyXuJZDrR3Z//fKkD+hGJ5mAYTrMSsi2gb71O+hsYi8MviK39 JZWiL8afpnYGkgj8T8eu5jfmEVlbRMzaN2P/V4go= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dennis Dalessandro , Mike Marciniszyn , Doug Ledford Subject: [PATCH 4.9 005/102] IB/hfi1: Silence txreq allocation warnings Date: Mon, 8 Jul 2019 17:11:58 +0200 Message-Id: <20190708150526.265563006@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150525.973820964@linuxfoundation.org> References: <20190708150525.973820964@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Marciniszyn commit 3230f4a8d44e4a0bb7afea814b280b5129521f52 upstream. The following warning can happen when a memory shortage occurs during txreq allocation: [10220.939246] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) [10220.939246] Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0018.C4.072020161249 07/20/2016 [10220.939247] cache: mnt_cache, object size: 384, buffer size: 384, default order: 2, min order: 0 [10220.939260] Workqueue: hfi0_0 _hfi1_do_send [hfi1] [10220.939261] node 0: slabs: 1026568, objs: 43115856, free: 0 [10220.939262] Call Trace: [10220.939262] node 1: slabs: 820872, objs: 34476624, free: 0 [10220.939263] dump_stack+0x5a/0x73 [10220.939265] warn_alloc+0x103/0x190 [10220.939267] ? wake_all_kswapds+0x54/0x8b [10220.939268] __alloc_pages_slowpath+0x86c/0xa2e [10220.939270] ? __alloc_pages_nodemask+0x2fe/0x320 [10220.939271] __alloc_pages_nodemask+0x2fe/0x320 [10220.939273] new_slab+0x475/0x550 [10220.939275] ___slab_alloc+0x36c/0x520 [10220.939287] ? hfi1_make_rc_req+0x90/0x18b0 [hfi1] [10220.939299] ? __get_txreq+0x54/0x160 [hfi1] [10220.939310] ? hfi1_make_rc_req+0x90/0x18b0 [hfi1] [10220.939312] __slab_alloc+0x40/0x61 [10220.939323] ? hfi1_make_rc_req+0x90/0x18b0 [hfi1] [10220.939325] kmem_cache_alloc+0x181/0x1b0 [10220.939336] hfi1_make_rc_req+0x90/0x18b0 [hfi1] [10220.939348] ? hfi1_verbs_send_dma+0x386/0xa10 [hfi1] [10220.939359] ? find_prev_entry+0xb0/0xb0 [hfi1] [10220.939371] hfi1_do_send+0x1d9/0x3f0 [hfi1] [10220.939372] process_one_work+0x171/0x380 [10220.939374] worker_thread+0x49/0x3f0 [10220.939375] kthread+0xf8/0x130 [10220.939377] ? max_active_store+0x80/0x80 [10220.939378] ? kthread_bind+0x10/0x10 [10220.939379] ret_from_fork+0x35/0x40 [10220.939381] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) The shortage is handled properly so the message isn't needed. Silence by adding the no warn option to the slab allocation. Fixes: 45842abbb292 ("staging/rdma/hfi1: move txreq header code") Cc: Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/hfi1/verbs_txreq.c | 2 +- drivers/infiniband/hw/hfi1/verbs_txreq.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/drivers/infiniband/hw/hfi1/verbs_txreq.c +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.c @@ -100,7 +100,7 @@ struct verbs_txreq *__get_txreq(struct h if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) { struct hfi1_qp_priv *priv; - tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); + tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP); if (tx) goto out; priv = qp->priv; --- a/drivers/infiniband/hw/hfi1/verbs_txreq.h +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.h @@ -71,6 +71,7 @@ struct hfi1_ibdev; struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev, struct rvt_qp *qp); +#define VERBS_TXREQ_GFP (GFP_ATOMIC | __GFP_NOWARN) static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, struct rvt_qp *qp) __must_hold(&qp->slock) @@ -78,7 +79,7 @@ static inline struct verbs_txreq *get_tx struct verbs_txreq *tx; struct hfi1_qp_priv *priv = qp->priv; - tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); + tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP); if (unlikely(!tx)) { /* call slow path to get the lock */ tx = __get_txreq(dev, qp);