<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Ingo Molnar &lt;mingo@elte.hu&gt;

The attached patch fixes long scheduling latencies caused by backlog
triggered by __release_sock().  That code only executes in process context,
and we've made the backlog queue private already at this point so it is
safe to do a cond_resched_softirq().

This patch has been in the -VP patchset for some time.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/net/core/sock.c |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -puN net/core/sock.c~sched-net-fix-scheduling-latencies-in-__release_sock net/core/sock.c
--- 25/net/core/sock.c~sched-net-fix-scheduling-latencies-in-__release_sock	Tue Sep 14 17:39:52 2004
+++ 25-akpm/net/core/sock.c	Tue Sep 14 17:39:52 2004
@@ -933,6 +933,15 @@ void __release_sock(struct sock *sk)
 
 			skb-&gt;next = NULL;
 			sk-&gt;sk_backlog_rcv(sk, skb);
+
+			/*
+			 * We are in process context here with softirqs
+			 * disabled, use cond_resched_softirq() to preempt.
+			 * This is safe to do because we've taken the backlog
+			 * queue private:
+			 */
+			cond_resched_softirq();
+
 			skb = next;
 		} while (skb != NULL);
 
_
</pre></body></html>