All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manjunath Patil <manjunath.b.patil@oracle.com>
To: santosh.shilimkar@oracle.com
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	aruna.ramakrishna@oracle.com, rama.nichanamatlu@oracle.com
Subject: [PATCH 1/1] net/rds: suppress page allocation failure error in recv buffer refill
Date: Wed, 16 Sep 2020 12:08:46 -0700	[thread overview]
Message-ID: <1600283326-30323-1-git-send-email-manjunath.b.patil@oracle.com> (raw)

RDS/IB tries to refill the recv buffer in softirq context using
GFP_NOWAIT flag. However alloc failure is handled by queueing a work to
refill the recv buffer with GFP_KERNEL flag. This means failure to
allocate with GFP_NOWAIT isn't fatal. Do not print the PAF warnings if
softirq context fails to refill the recv buffer, instead print a one
line warning once a day.

Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
Reviewed-by: Aruna Ramakrishna <aruna.ramakrishna@oracle.com>
---
 net/rds/ib_recv.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 694d411dc72f..38d2894f6bb2 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -310,8 +310,8 @@ static int rds_ib_recv_refill_one(struct rds_connection *conn,
 	struct rds_ib_connection *ic = conn->c_transport_data;
 	struct ib_sge *sge;
 	int ret = -ENOMEM;
-	gfp_t slab_mask = GFP_NOWAIT;
-	gfp_t page_mask = GFP_NOWAIT;
+	gfp_t slab_mask = gfp;
+	gfp_t page_mask = gfp;
 
 	if (gfp & __GFP_DIRECT_RECLAIM) {
 		slab_mask = GFP_KERNEL;
@@ -406,6 +406,16 @@ void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp)
 		recv = &ic->i_recvs[pos];
 		ret = rds_ib_recv_refill_one(conn, recv, gfp);
 		if (ret) {
+			static unsigned long warn_time;
+			/* warn max once per day. This should be enough to
+			 * warn users about low mem situation.
+			 */
+			if (printk_timed_ratelimit(&warn_time,
+						   24 * 60 * 60 * 1000))
+				pr_warn("RDS/IB: failed to refill recv buffer for <%pI6c,%pI6c,%d>, waking worker\n",
+					&conn->c_laddr, &conn->c_faddr,
+					conn->c_tos);
+
 			must_wake = true;
 			break;
 		}
@@ -1020,7 +1030,7 @@ void rds_ib_recv_cqe_handler(struct rds_ib_connection *ic,
 		rds_ib_stats_inc(s_ib_rx_ring_empty);
 
 	if (rds_ib_ring_low(&ic->i_recv_ring)) {
-		rds_ib_recv_refill(conn, 0, GFP_NOWAIT);
+		rds_ib_recv_refill(conn, 0, GFP_NOWAIT | __GFP_NOWARN);
 		rds_ib_stats_inc(s_ib_rx_refill_from_cq);
 	}
 }
-- 
2.27.0.112.g101b320


             reply	other threads:[~2020-09-16 19:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 19:08 Manjunath Patil [this message]
2020-09-16 19:27 ` [PATCH 1/1] net/rds: suppress page allocation failure error in recv buffer refill santosh.shilimkar
2020-09-16 21:15   ` Manjunath Patil
2020-09-16 21:25     ` santosh.shilimkar
2020-09-16 21:35       ` Manjunath Patil
2020-10-02 20:05 Manjunath Patil
2020-10-02 20:10 ` santosh.shilimkar
2020-10-02 20:23   ` Manjunath Patil
2020-10-04  0:26 ` David Miller
2020-10-05 21:39   ` Manjunath Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600283326-30323-1-git-send-email-manjunath.b.patil@oracle.com \
    --to=manjunath.b.patil@oracle.com \
    --cc=aruna.ramakrishna@oracle.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rama.nichanamatlu@oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.