Skip to contentSkip to conversation

remove last_rx update from loopback device

PATCH Applied [email protected] 5 participants 8 messages Mar 15, 2005 – Mar 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/13 remove last_rx update from loopback device

From: Christoph Lameter <[email protected]>

The last_rx field in the loopback driver is updated on every xmit but is not used otherwise. Accesses to ->last_rx cause unecessary traffic on the interlink for NUMA systems which limits the performance of the loopback device.

The comment given at include/linux/netdevice.h says that last_rx may be used for future network-power-down code, which is likely not relevant for the loopback device (please let me know if it is otherwise ..).

---

 25-akpm/drivers/net/loopback.c |    2 --
 1 files changed, 2 deletions(-)
drivers/net/loopback.c renamed from drivers/net/loopback.c~remove-last_rx-update-from-loopback-device +0 -2
diff -puN drivers/net/loopback.c~remove-last_rx-update-from-loopback-device drivers/net/loopback.c
@@ -144,8 +144,6 @@ static int loopback_xmit(struct sk_buff 
 		return 0;
 	}
 
-	dev->last_rx = jiffies;
-
 	lb_stats = &per_cpu(loopback_stats, get_cpu());
 	lb_stats->rx_bytes += skb->len;
 	lb_stats->tx_bytes += skb->len;

_

#1 lore raw
Quoted 24 lines · [email protected] wrote:

From: Christoph Lameter <[email protected]>

The last_rx field in the loopback driver is updated on every xmit but is not used otherwise. Accesses to ->last_rx cause unecessary traffic on the interlink for NUMA systems which limits the performance of the loopback device.

The comment given at include/linux/netdevice.h says that last_rx may be used for future network-power-down code, which is likely not relevant for the loopback device (please let me know if it is otherwise ..).

---

 25-akpm/drivers/net/loopback.c |    2 --
 1 files changed, 2 deletions(-)

diff -puN drivers/net/loopback.c~remove-last_rx-update-from-loopback-device drivers/net/loopback.c

drivers/net/loopback.c static int loopback_xmit(struct sk_buff · line 149

Quoted 8 lines
drivers/net/loopback.c renamed from drivers/net/loopback.c~remove-last_rx-update-from-loopback-device +0 -2
@@ -144,8 +144,6 @@ static int loopback_xmit(struct sk_buff 
 		return 0;
 	}
 
-	dev->last_rx = jiffies;
-
 	lb_stats = &per_cpu(loopback_stats, get_cpu());
 	lb_stats->rx_bytes += skb->len;
 	lb_stats->tx_bytes += skb->len;

I disagree. loopback.c is doing precisely what it should be doing.

Jeff

#2 lore raw
Quoted 8 lines · Jeff Garzik

drivers/net/loopback.c static int loopback_xmit(struct sk_buff · line 149

Quoted 6 lines
drivers/net/loopback.c renamed from drivers/net/loopback.c~remove-last_rx-update-from-loopback-device +0 -2
-	dev->last_rx = jiffies;
-
 	lb_stats = &per_cpu(loopback_stats, get_cpu());
 	lb_stats->rx_bytes += skb->len;
 	lb_stats->tx_bytes += skb->len;

I disagree. loopback.c is doing precisely what it should be doing.

Nothing actually seems to use last_rx?

maintainer
#3 lore raw
Quoted 11 lines · On Tue, 15 Mar 2005 15:08:09 -0800 Andrew Morton <[email protected]> wrote:
Quoted 8 lines · Jeff Garzik

drivers/net/loopback.c static int loopback_xmit(struct sk_buff · line 149

Quoted 6 lines
drivers/net/loopback.c renamed from drivers/net/loopback.c~remove-last_rx-update-from-loopback-device +0 -2
-	dev->last_rx = jiffies;
-
 	lb_stats = &per_cpu(loopback_stats, get_cpu());
 	lb_stats->rx_bytes += skb->len;
 	lb_stats->tx_bytes += skb->len;

I disagree. loopback.c is doing precisely what it should be doing.

Nothing actually seems to use last_rx?

For one thing bonding load balancing uses it.

You can argue that bonding of loopback devices is silly. But there are other things one might be able to do with last_rx and the fact that every driver faithfully sets it means that it's a reliable metric to use without special cases.

These loopback driver SMP optimizations are starting to really driver me crazy.

#4 lore raw
Quoted 2 lines

These loopback driver SMP optimizations are starting to really driver me crazy.

Correct or not, I suspect there are a non-trivial number of folks out there who use loopback performance as an indicator of over the network performance or at least of stack path length (less driver). particularly when they have only one system and want to make quick (and so worth all the time they put into it) comparisons between OSes.

Perhaps that is a driver-ing (since punning drive/driver seems to be the order N squared of the day) force behind the changes?

rick jones

maintainer
#5 lore raw
Quoted 2 lines · On Tue, 15 Mar 2005 17:04:23 -0800 Rick Jones <[email protected]> wrote:

Perhaps that is a driver-ing (since punning drive/driver seems to be the order N squared of the day) force behind the changes?

Every time the SGI guys with the 512 cpu machine find some shared memory reference they think they can legitimately remove, they try to do so.

#6 lore raw
In reply to Rick Jones
Quoted 5 lines · Rick Jones
Quoted 2 lines

These loopback driver SMP optimizations are starting to really driver me crazy.

Correct or not, I suspect there are a non-trivial number of folks out there who use loopback performance as an indicator of over the network performance or at least of stack path length (less driver).

I hope not the former. Given that loopback performance is *significantly* faster than network performance, increasing the performance of the loopback driver in these somewhat artificial ways (that differ from the real network device path) simply *increases* the inaccuracy of their testing and the conclusions they can draw from it ;).

thanks,
Nivedita

#7 lore raw
Quoted 10 lines · Nivedita Singhvi
Quoted 6 lines · Rick Jones
Quoted 2 lines

These loopback driver SMP optimizations are starting to really driver me crazy.

Correct or not, I suspect there are a non-trivial number of folks out there who use loopback performance as an indicator of over the network performance or at least of stack path length (less driver).

Quoted 6 lines

I hope not the former. Given that loopback performance is *significantly* faster than network performance, increasing the performance of the loopback driver in these somewhat artificial ways (that differ from the real network device path) simply *increases* the inaccuracy of their testing and the conclusions they can draw from it ;).

I suspect the idea is that if loopback on Platform A is faster than loopback on Platform B, then over the network will be faster (or at least more efficient) on Platform A than it is on Platform B.

It is indeed fraught with numerous pitfalls - different MTU's, shorticircuting at different places etc etc.

I do not claim to condone (even if I'm sometimes forced into that situation myself :( ) merely to explain.

As for the 512 CPU machine mentioned in another message, at the rate cores per die may increase over the next few years, that may not really be all that large a box... :)

rick jones