diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-12-25 22:34:11 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-12-25 22:34:41 -0500 |
commit | 85ed4003a1456624fb61c6eb6c934aead9900e5a (patch) | |
tree | 2ab1a636b4eb2dc85f88ce3f92b101ca78cd6b55 | |
parent | 6d940a35f86edb0a9fe25cf60a2b5a7958b00af0 (diff) | |
download | 4.9-rt-patches-85ed4003a1456624fb61c6eb6c934aead9900e5a.tar.gz |
skbufhead: import rawlock 2 --> 1 patch merge and updates
-rw-r--r-- | patches/series | 1 | ||||
-rw-r--r-- | patches/skbufhead-raw-lock-free-skbs.patch | 37 | ||||
-rw-r--r-- | patches/skbufhead-raw-lock.patch | 72 |
3 files changed, 58 insertions, 52 deletions
diff --git a/patches/series b/patches/series index ef7f2e4776a065..431c1189037031 100644 --- a/patches/series +++ b/patches/series @@ -422,7 +422,6 @@ seqlock-prevent-rt-starvation.patch # NETWORKING sunrpc-make-svc_xprt_do_enqueue-use-get_cpu_light.patch skbufhead-raw-lock.patch -skbufhead-raw-lock-free-skbs.patch net-core-cpuhotplug-drain-input_pkt_queue-lockless.patch net-move-xmit_recursion-to-per-task-variable-on-RT.patch net-provide-a-way-to-delegate-processing-a-softirq-t.patch diff --git a/patches/skbufhead-raw-lock-free-skbs.patch b/patches/skbufhead-raw-lock-free-skbs.patch deleted file mode 100644 index 76863f5d6d4680..00000000000000 --- a/patches/skbufhead-raw-lock-free-skbs.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 05 Dec 2016 18:09:34 +0100 -Subject: net: free the sbs in skbufhead - -In "skbufhead-raw-lock.patch" we moved the memory to a list and the hunk that -cleared the list got misplaced. - -Cc: stable@vger.kernel.org -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - net/core/dev.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -5201,13 +5201,21 @@ static void net_rx_action(struct softirq - struct softnet_data *sd = this_cpu_ptr(&softnet_data); - unsigned long time_limit = jiffies + 2; - int budget = netdev_budget; -+ struct sk_buff_head tofree_q; -+ struct sk_buff *skb; - LIST_HEAD(list); - LIST_HEAD(repoll); - -+ __skb_queue_head_init(&tofree_q); -+ - local_irq_disable(); -+ skb_queue_splice_init(&sd->tofree_queue, &tofree_q); - list_splice_init(&sd->poll_list, &list); - local_irq_enable(); - -+ while ((skb = __skb_dequeue(&tofree_q))) -+ kfree_skb(skb); -+ - for (;;) { - struct napi_struct *n; - diff --git a/patches/skbufhead-raw-lock.patch b/patches/skbufhead-raw-lock.patch index 18cc08162b1d22..4bb689f258eac6 100644 --- a/patches/skbufhead-raw-lock.patch +++ b/patches/skbufhead-raw-lock.patch @@ -10,12 +10,12 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h | 7 +++++++ - net/core/dev.c | 19 +++++++++++++------ - 3 files changed, 21 insertions(+), 6 deletions(-) + net/core/dev.c | 31 ++++++++++++++++++++++++------- + 3 files changed, 32 insertions(+), 7 deletions(-) --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -2831,6 +2831,7 @@ struct softnet_data { +@@ -2846,6 +2846,7 @@ struct softnet_data { unsigned int dropped; struct sk_buff_head input_pkt_queue; struct napi_struct backlog; @@ -33,7 +33,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> }; struct sk_buff; -@@ -1565,6 +1566,12 @@ static inline void skb_queue_head_init(s +@@ -1573,6 +1574,12 @@ static inline void skb_queue_head_init(s __skb_queue_head_init(list); } @@ -65,31 +65,75 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #endif } -@@ -4323,7 +4323,7 @@ static void flush_backlog(void *arg) +@@ -4315,7 +4315,7 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { - if (skb->dev == dev) { + if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->input_pkt_queue); - kfree_skb(skb); + __skb_queue_tail(&sd->tofree_queue, skb); input_queue_head_incr(sd); } } -@@ -4332,10 +4332,13 @@ static void flush_backlog(void *arg) +@@ -4325,11 +4325,14 @@ static void flush_backlog(struct work_st skb_queue_walk_safe(&sd->process_queue, skb, tmp) { - if (skb->dev == dev) { + if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); - kfree_skb(skb); + __skb_queue_tail(&sd->tofree_queue, skb); input_queue_head_incr(sd); } } -+ + if (!skb_queue_empty(&sd->tofree_queue)) + raise_softirq_irqoff(NET_RX_SOFTIRQ); + local_bh_enable(); ++ } - static int napi_gro_complete(struct sk_buff *skb) -@@ -8004,6 +8007,9 @@ static int dev_cpu_callback(struct notif + static void flush_all_backlogs(void) +@@ -4852,7 +4855,9 @@ static int process_backlog(struct napi_s + while (again) { + struct sk_buff *skb; + ++ local_irq_disable(); + while ((skb = __skb_dequeue(&sd->process_queue))) { ++ local_irq_enable(); + rcu_read_lock(); + __netif_receive_skb(skb); + rcu_read_unlock(); +@@ -4860,9 +4865,9 @@ static int process_backlog(struct napi_s + if (++work >= quota) + return work; + ++ local_irq_disable(); + } + +- local_irq_disable(); + rps_lock(sd); + if (skb_queue_empty(&sd->input_pkt_queue)) { + /* +@@ -5204,13 +5209,21 @@ static __latent_entropy void net_rx_acti + struct softnet_data *sd = this_cpu_ptr(&softnet_data); + unsigned long time_limit = jiffies + 2; + int budget = netdev_budget; ++ struct sk_buff_head tofree_q; ++ struct sk_buff *skb; + LIST_HEAD(list); + LIST_HEAD(repoll); + ++ __skb_queue_head_init(&tofree_q); ++ + local_irq_disable(); ++ skb_queue_splice_init(&sd->tofree_queue, &tofree_q); + list_splice_init(&sd->poll_list, &list); + local_irq_enable(); + ++ while ((skb = __skb_dequeue(&tofree_q))) ++ kfree_skb(skb); ++ + for (;;) { + struct napi_struct *n; + +@@ -8013,6 +8026,9 @@ static int dev_cpu_callback(struct notif netif_rx_ni(skb); input_queue_head_incr(oldsd); } @@ -99,9 +143,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return NOTIFY_OK; } -@@ -8305,8 +8311,9 @@ static int __init net_dev_init(void) - for_each_possible_cpu(i) { - struct softnet_data *sd = &per_cpu(softnet_data, i); +@@ -8317,8 +8333,9 @@ static int __init net_dev_init(void) + + INIT_WORK(flush, flush_backlog); - skb_queue_head_init(&sd->input_pkt_queue); - skb_queue_head_init(&sd->process_queue); |