From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, davem@davemloft.net,
ssantosh@kernel.org,
Santosh Shilimkar <santosh.shilimkar@oracle.com>
Subject: [PATCH 02/14] RDS: always free recv frag as we free its ring entry
Date: Sat, 22 Aug 2015 15:45:23 -0700 [thread overview]
Message-ID: <1440283535-4800-3-git-send-email-santosh.shilimkar@oracle.com> (raw)
In-Reply-To: <1440283535-4800-1-git-send-email-santosh.shilimkar@oracle.com>
We were still seeing rare occurrences of the WARN_ON(recv->r_frag) which
indicates that the recv refill path was finding allocated frags in ring
entries that were marked free. These were usually followed by OOM crashes.
They only seem to be occurring in the presence of completion errors and
connection resets.
This patch ensures that we free the frag as we mark the ring entry free.
This should stop the refill path from finding allocated frags in ring
entries that were marked free.
Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
net/rds/ib_recv.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index cac5b45..2a6a75c 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -982,10 +982,17 @@ static inline void rds_poll_cq(struct rds_ib_connection *ic,
}
/*
- * It's very important that we only free this ring entry if we've truly
- * freed the resources allocated to the entry. The refilling path can
- * leak if we don't.
+ * rds_ib_process_recv() doesn't always consume the frag, and
+ * we might not have called it at all if the wc didn't indicate
+ * success. We already unmapped the frag's pages, though, and
+ * the following rds_ib_ring_free() call tells the refill path
+ * that it will not find an allocated frag here. Make sure we
+ * keep that promise by freeing a frag that's still on the ring.
*/
+ if (recv->r_frag) {
+ rds_ib_frag_free(ic, recv->r_frag);
+ recv->r_frag = NULL;
+ }
rds_ib_ring_free(&ic->i_recv_ring, 1);
}
}
--
1.9.1
next prev parent reply other threads:[~2015-08-22 22:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-22 22:45 [PATCH 00/14] RDS: Assorted bug fixes Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 01/14] RDS: restore return value in rds_cmsg_rdma_args() Santosh Shilimkar
2015-08-22 22:45 ` Santosh Shilimkar [this message]
2015-08-22 22:45 ` [PATCH 03/14] RDS: destroy the ib state earlier during shutdown Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 04/14] RDS: don't update ip address tables if the address hasn't changed Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 05/14] RDS: make sure we post recv buffers Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 06/14] RDS: check for congestion updates during rds_send_xmit Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 07/14] RDS: add a sock_destruct callback debug aid Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 08/14] RDS: Mark message mapped before transmit Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 09/14] RDS: Make sure we do a signaled send for large-send Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 10/14] RDS: Fix assertion level from fatal to warning Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 11/14] RDS: Don't destroy the rdma id until after we're done using it Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 12/14] RDS: make sure rds_send_drop_to properly takes the m_rs_lock Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 13/14] RDS: return EMSGSIZE for oversize requests before processing/queueing Santosh Shilimkar
2015-08-22 22:45 ` [PATCH 14/14] RDS: check for valid cm_id before initiating connection Santosh Shilimkar
2015-08-25 20:35 ` [PATCH 00/14] RDS: Assorted bug fixes David Miller
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=1440283535-4800-3-git-send-email-santosh.shilimkar@oracle.com \
--to=santosh.shilimkar@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ssantosh@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).