[kernel] r16371 - in dists/sid/linux-2.6/debian/patches: debian features/all/openvz series

Ben Hutchings benh at alioth.debian.org
Wed Sep 29 11:25:13 UTC 2010


Author: benh
Date: Wed Sep 29 11:25:10 2010
New Revision: 16371

Log:
Revert TCP orphan handling changes from 2.6.32.23 for OpenVZ

Added:
   dists/sid/linux-2.6/debian/patches/debian/revert-tcp-Combat-per-cpu-skew-in-orphan-tests.patch
Modified:
   dists/sid/linux-2.6/debian/patches/features/all/openvz/openvz.patch
   dists/sid/linux-2.6/debian/patches/series/24-extra

Added: dists/sid/linux-2.6/debian/patches/debian/revert-tcp-Combat-per-cpu-skew-in-orphan-tests.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/debian/revert-tcp-Combat-per-cpu-skew-in-orphan-tests.patch	Wed Sep 29 11:25:10 2010	(r16371)
@@ -0,0 +1,90 @@
+From 8af9c3b2b42b54a8e559788a635d149825ad696e Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Wed, 29 Sep 2010 12:15:58 +0100
+Subject: [PATCH] Revert "tcp: Combat per-cpu skew in orphan tests."
+
+This reverts commit a89d316f2bdf5df8f9a109d32f0e7b0940041e7f which
+conflicts with OpenVZ's changes to orphan accounting.
+---
+ include/net/tcp.h    |   18 ++++--------------
+ net/ipv4/tcp.c       |    5 ++++-
+ net/ipv4/tcp_timer.c |    8 ++++----
+ 3 files changed, 12 insertions(+), 19 deletions(-)
+
+diff --git a/include/net/tcp.h b/include/net/tcp.h
+index 6cfe18b..ec82a6b 100644
+--- a/include/net/tcp.h
++++ b/include/net/tcp.h
+@@ -259,21 +259,11 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
+ 	return seq3 - seq2 >= seq1 - seq2;
+ }
+ 
+-static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
++static inline int tcp_too_many_orphans(struct sock *sk, int num)
+ {
+-	struct percpu_counter *ocp = sk->sk_prot->orphan_count;
+-	int orphans = percpu_counter_read_positive(ocp);
+-
+-	if (orphans << shift > sysctl_tcp_max_orphans) {
+-		orphans = percpu_counter_sum_positive(ocp);
+-		if (orphans << shift > sysctl_tcp_max_orphans)
+-			return true;
+-	}
+-
+-	if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
+-	    atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])
+-		return true;
+-	return false;
++	return (num > sysctl_tcp_max_orphans) ||
++		(sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
++		 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
+ }
+ 
+ /* syncookies: remember time of last synqueue overflow */
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
+index 108fad0..f6c52c7 100644
+--- a/net/ipv4/tcp.c
++++ b/net/ipv4/tcp.c
+@@ -1977,8 +1977,11 @@ adjudge_to_death:
+ 		}
+ 	}
+ 	if (sk->sk_state != TCP_CLOSE) {
++		int orphan_count = percpu_counter_read_positive(
++						sk->sk_prot->orphan_count);
++
+ 		sk_mem_reclaim(sk);
+-		if (tcp_too_many_orphans(sk, 0)) {
++		if (tcp_too_many_orphans(sk, orphan_count)) {
+ 			if (net_ratelimit())
+ 				printk(KERN_INFO "TCP: too many of orphaned "
+ 				       "sockets\n");
+diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
+index 57d5501..cdb2ca7 100644
+--- a/net/ipv4/tcp_timer.c
++++ b/net/ipv4/tcp_timer.c
+@@ -65,18 +65,18 @@ static void tcp_write_err(struct sock *sk)
+ static int tcp_out_of_resources(struct sock *sk, int do_reset)
+ {
+ 	struct tcp_sock *tp = tcp_sk(sk);
+-	int shift = 0;
++	int orphans = percpu_counter_read_positive(&tcp_orphan_count);
+ 
+ 	/* If peer does not open window for long time, or did not transmit
+ 	 * anything for long time, penalize it. */
+ 	if ((s32)(tcp_time_stamp - tp->lsndtime) > 2*TCP_RTO_MAX || !do_reset)
+-		shift++;
++		orphans <<= 1;
+ 
+ 	/* If some dubious ICMP arrived, penalize even more. */
+ 	if (sk->sk_err_soft)
+-		shift++;
++		orphans <<= 1;
+ 
+-	if (tcp_too_many_orphans(sk, shift)) {
++	if (tcp_too_many_orphans(sk, orphans)) {
+ 		if (net_ratelimit())
+ 			printk(KERN_INFO "Out of socket memory\n");
+ 
+-- 
+1.7.1
+

Modified: dists/sid/linux-2.6/debian/patches/features/all/openvz/openvz.patch
==============================================================================
--- dists/sid/linux-2.6/debian/patches/features/all/openvz/openvz.patch	Wed Sep 29 11:20:37 2010	(r16370)
+++ dists/sid/linux-2.6/debian/patches/features/all/openvz/openvz.patch	Wed Sep 29 11:25:10 2010	(r16371)
@@ -6130,9 +6130,6 @@
     Neither compiles, nor works.
     
     Signed-off-by: Pavel Emelyanov <xemul at openvz.org>
-
-[bwh: Resolve conflict with TCP orphan accounting changes in 2.6.32.23]
-
 diff --git a/COPYING.Parallels b/COPYING.Parallels
 new file mode 100644
 index 0000000..9856a2b
@@ -84795,14 +84792,16 @@
  
  	/* Have we already been destroyed by a softirq or backlog? */
  	if (state != TCP_CLOSE && sk->sk_state == TCP_CLOSE)
-@@ -1975,11 +2039,19 @@ adjudge_to_death:
+@@ -1975,14 +2039,19 @@ adjudge_to_death:
  		}
  	}
  	if (sk->sk_state != TCP_CLOSE) {
+-		int orphan_count = percpu_counter_read_positive(
+-						sk->sk_prot->orphan_count);
 +		int orphans = ub_get_orphan_count(sk);
-+
+ 
  		sk_mem_reclaim(sk);
--		if (tcp_too_many_orphans(sk, 0)) {
+-		if (tcp_too_many_orphans(sk, orphan_count)) {
 -			if (net_ratelimit())
 +		if (ub_too_many_orphans(sk, orphans)) {
 +			if (net_ratelimit()) {
@@ -85464,7 +85463,7 @@
  static int tcp_out_of_resources(struct sock *sk, int do_reset)
  {
  	struct tcp_sock *tp = tcp_sk(sk);
--	int shift = 0;
+-	int orphans = percpu_counter_read_positive(&tcp_orphan_count);
 +	int orphans = ub_get_orphan_count(sk);
 +	int orph = orphans;
  
@@ -85472,9 +85471,9 @@
  	 * anything for long time, penalize it. */
 @@ -76,10 +79,16 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
  	if (sk->sk_err_soft)
- 		shift++;
+ 		orphans <<= 1;
  
--	if (tcp_too_many_orphans(sk, shift)) {
+-	if (tcp_too_many_orphans(sk, orphans)) {
 -		if (net_ratelimit())
 -			printk(KERN_INFO "Out of socket memory\n");
 -

Modified: dists/sid/linux-2.6/debian/patches/series/24-extra
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/24-extra	Wed Sep 29 11:20:37 2010	(r16370)
+++ dists/sid/linux-2.6/debian/patches/series/24-extra	Wed Sep 29 11:25:10 2010	(r16371)
@@ -1,3 +1,4 @@
++ debian/revert-tcp-Combat-per-cpu-skew-in-orphan-tests.patch featureset=openvz
 + features/all/openvz/openvz.patch featureset=openvz
 + features/all/openvz/cfq-iosched-do-not-force-idling-for-sync-workload.patch featureset=openvz
 



More information about the Kernel-svn-changes mailing list