]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.130/ib-hfi1-silence-txreq-allocation-warnings.patch
Linux 4.19.56
[thirdparty/kernel/stable-queue.git] / releases / 4.14.130 / ib-hfi1-silence-txreq-allocation-warnings.patch
1 From 3230f4a8d44e4a0bb7afea814b280b5129521f52 Mon Sep 17 00:00:00 2001
2 From: Mike Marciniszyn <mike.marciniszyn@intel.com>
3 Date: Fri, 14 Jun 2019 12:32:32 -0400
4 Subject: IB/hfi1: Silence txreq allocation warnings
5
6 From: Mike Marciniszyn <mike.marciniszyn@intel.com>
7
8 commit 3230f4a8d44e4a0bb7afea814b280b5129521f52 upstream.
9
10 The following warning can happen when a memory shortage
11 occurs during txreq allocation:
12
13 [10220.939246] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
14 [10220.939246] Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0018.C4.072020161249 07/20/2016
15 [10220.939247] cache: mnt_cache, object size: 384, buffer size: 384, default order: 2, min order: 0
16 [10220.939260] Workqueue: hfi0_0 _hfi1_do_send [hfi1]
17 [10220.939261] node 0: slabs: 1026568, objs: 43115856, free: 0
18 [10220.939262] Call Trace:
19 [10220.939262] node 1: slabs: 820872, objs: 34476624, free: 0
20 [10220.939263] dump_stack+0x5a/0x73
21 [10220.939265] warn_alloc+0x103/0x190
22 [10220.939267] ? wake_all_kswapds+0x54/0x8b
23 [10220.939268] __alloc_pages_slowpath+0x86c/0xa2e
24 [10220.939270] ? __alloc_pages_nodemask+0x2fe/0x320
25 [10220.939271] __alloc_pages_nodemask+0x2fe/0x320
26 [10220.939273] new_slab+0x475/0x550
27 [10220.939275] ___slab_alloc+0x36c/0x520
28 [10220.939287] ? hfi1_make_rc_req+0x90/0x18b0 [hfi1]
29 [10220.939299] ? __get_txreq+0x54/0x160 [hfi1]
30 [10220.939310] ? hfi1_make_rc_req+0x90/0x18b0 [hfi1]
31 [10220.939312] __slab_alloc+0x40/0x61
32 [10220.939323] ? hfi1_make_rc_req+0x90/0x18b0 [hfi1]
33 [10220.939325] kmem_cache_alloc+0x181/0x1b0
34 [10220.939336] hfi1_make_rc_req+0x90/0x18b0 [hfi1]
35 [10220.939348] ? hfi1_verbs_send_dma+0x386/0xa10 [hfi1]
36 [10220.939359] ? find_prev_entry+0xb0/0xb0 [hfi1]
37 [10220.939371] hfi1_do_send+0x1d9/0x3f0 [hfi1]
38 [10220.939372] process_one_work+0x171/0x380
39 [10220.939374] worker_thread+0x49/0x3f0
40 [10220.939375] kthread+0xf8/0x130
41 [10220.939377] ? max_active_store+0x80/0x80
42 [10220.939378] ? kthread_bind+0x10/0x10
43 [10220.939379] ret_from_fork+0x35/0x40
44 [10220.939381] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
45
46 The shortage is handled properly so the message isn't needed. Silence by
47 adding the no warn option to the slab allocation.
48
49 Fixes: 45842abbb292 ("staging/rdma/hfi1: move txreq header code")
50 Cc: <stable@vger.kernel.org>
51 Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
52 Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
53 Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
54 Signed-off-by: Doug Ledford <dledford@redhat.com>
55 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
56
57 ---
58 drivers/infiniband/hw/hfi1/verbs_txreq.c | 2 +-
59 drivers/infiniband/hw/hfi1/verbs_txreq.h | 3 ++-
60 2 files changed, 3 insertions(+), 2 deletions(-)
61
62 --- a/drivers/infiniband/hw/hfi1/verbs_txreq.c
63 +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.c
64 @@ -100,7 +100,7 @@ struct verbs_txreq *__get_txreq(struct h
65 if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) {
66 struct hfi1_qp_priv *priv;
67
68 - tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
69 + tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP);
70 if (tx)
71 goto out;
72 priv = qp->priv;
73 --- a/drivers/infiniband/hw/hfi1/verbs_txreq.h
74 +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.h
75 @@ -72,6 +72,7 @@ struct hfi1_ibdev;
76 struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,
77 struct rvt_qp *qp);
78
79 +#define VERBS_TXREQ_GFP (GFP_ATOMIC | __GFP_NOWARN)
80 static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
81 struct rvt_qp *qp)
82 __must_hold(&qp->slock)
83 @@ -79,7 +80,7 @@ static inline struct verbs_txreq *get_tx
84 struct verbs_txreq *tx;
85 struct hfi1_qp_priv *priv = qp->priv;
86
87 - tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
88 + tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP);
89 if (unlikely(!tx)) {
90 /* call slow path to get the lock */
91 tx = __get_txreq(dev, qp);