Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1310250

[PATCH RT 2/2] net/core: skbuf use local lock in __netdev_alloc_skb()

From Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Newsgroups linux.kernel
Subject [PATCH RT 2/2] net/core: skbuf use local lock in __netdev_alloc_skb()
Date 2016-01-15 17:30 +0100
Message-ID <qRfqa-cf-5@gated-at.bofh.it> (permalink)
References <qRfgv-8O-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


local_irq_save() was introduced in v4.2-rc1 via 9451980a6646
("net: Use cached copy of pfmemalloc to avoid accessing page").
This is only v4.1-RT..v4.4-RT fallout.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 net/core/skbuff.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7c422e441f1c..53f10c2d7718 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -434,13 +434,13 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len,
 	if (sk_memalloc_socks())
 		gfp_mask |= __GFP_MEMALLOC;
 
-	local_irq_save(flags);
+	local_lock_irqsave(netdev_alloc_lock, flags);
 
 	nc = this_cpu_ptr(&netdev_alloc_cache);
 	data = __alloc_page_frag(nc, len, gfp_mask);
 	pfmemalloc = nc->pfmemalloc;
 
-	local_irq_restore(flags);
+	local_unlock_irqrestore(netdev_alloc_lock, flags);
 
 	if (unlikely(!data))
 		return NULL;
-- 
2.7.0.rc3

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH RT 1/2] net/core: protect users of napi_alloc_cache against  reentrance Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-15 17:20 +0100
  [PATCH RT 2/2] net/core: skbuf use local lock in __netdev_alloc_skb() Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-01-15 17:30 +0100

csiph-web