All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen-netback: fix occasional leak of grant ref mappings under memory pressure
@ 2019-02-28  2:03 Igor Druzhinin
  2019-02-28  9:46 ` Paul Durrant
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Igor Druzhinin @ 2019-02-28  2:03 UTC (permalink / raw)
  To: xen-devel, netdev, linux-kernel
  Cc: wei.liu2, paul.durrant, davem, Igor Druzhinin

Zero-copy callback flag is not yet set on frag list skb at the moment
xenvif_handle_frag_list() returns -ENOMEM. This eventually results in
leaking grant ref mappings since xenvif_zerocopy_callback() is never
called for these fragments. Those eventually build up and cause Xen
to kill Dom0 as the slots get reused for new mappings.

That behavior is observed under certain workloads where sudden spikes
of page cache usage for writes coexist with active atomic skb allocations.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
 drivers/net/xen-netback/netback.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 80aae3a..2023317 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1146,9 +1146,12 @@ static int xenvif_tx_submit(struct xenvif_queue *queue)
 
 		if (unlikely(skb_has_frag_list(skb))) {
 			if (xenvif_handle_frag_list(queue, skb)) {
+				struct sk_buff *nskb =
+						skb_shinfo(skb)->frag_list;
 				if (net_ratelimit())
 					netdev_err(queue->vif->dev,
 						   "Not enough memory to consolidate frag_list!\n");
+				xenvif_skb_zerocopy_prepare(queue, nskb);
 				xenvif_skb_zerocopy_prepare(queue, skb);
 				kfree_skb(skb);
 				continue;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread
* [PATCH] xen-netback: fix occasional leak of grant ref mappings under memory pressure
@ 2019-02-28  2:03 Igor Druzhinin
  0 siblings, 0 replies; 18+ messages in thread
From: Igor Druzhinin @ 2019-02-28  2:03 UTC (permalink / raw)
  To: xen-devel, netdev, linux-kernel
  Cc: Igor Druzhinin, paul.durrant, wei.liu2, davem

Zero-copy callback flag is not yet set on frag list skb at the moment
xenvif_handle_frag_list() returns -ENOMEM. This eventually results in
leaking grant ref mappings since xenvif_zerocopy_callback() is never
called for these fragments. Those eventually build up and cause Xen
to kill Dom0 as the slots get reused for new mappings.

That behavior is observed under certain workloads where sudden spikes
of page cache usage for writes coexist with active atomic skb allocations.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
 drivers/net/xen-netback/netback.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 80aae3a..2023317 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1146,9 +1146,12 @@ static int xenvif_tx_submit(struct xenvif_queue *queue)
 
 		if (unlikely(skb_has_frag_list(skb))) {
 			if (xenvif_handle_frag_list(queue, skb)) {
+				struct sk_buff *nskb =
+						skb_shinfo(skb)->frag_list;
 				if (net_ratelimit())
 					netdev_err(queue->vif->dev,
 						   "Not enough memory to consolidate frag_list!\n");
+				xenvif_skb_zerocopy_prepare(queue, nskb);
 				xenvif_skb_zerocopy_prepare(queue, skb);
 				kfree_skb(skb);
 				continue;
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-02-28 12:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28  2:03 [PATCH] xen-netback: fix occasional leak of grant ref mappings under memory pressure Igor Druzhinin
2019-02-28  9:46 ` Paul Durrant
2019-02-28 11:01   ` Wei Liu
2019-02-28 11:21     ` Paul Durrant
2019-02-28 11:21     ` Paul Durrant
2019-02-28 11:43       ` Igor Druzhinin
2019-02-28 11:43       ` Igor Druzhinin
2019-02-28 11:49         ` Paul Durrant
2019-02-28 11:49         ` Paul Durrant
2019-02-28 12:07       ` Paul Durrant
2019-02-28 12:37         ` Wei Liu
2019-02-28 12:37         ` Wei Liu
2019-02-28 12:07       ` Paul Durrant
2019-02-28 11:01   ` Wei Liu
2019-02-28  9:46 ` Paul Durrant
2019-02-28  9:50 ` Andrew Cooper
2019-02-28  9:50 ` [Xen-devel] " Andrew Cooper
  -- strict thread matches above, loose matches on Subject: below --
2019-02-28  2:03 Igor Druzhinin

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.