Skip to contentSkip to conversation

ethernet/arc/arc_emac: Fix huge delays in large file copies

PATCH Applied Vineet Gupta 3 participants 7 messages Sep 4, 2013 – Sep 17, 2013

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

PATCH 1/1 ethernet/arc/arc_emac: Fix huge delays in large file copies

copying large files to a NFS mounted host was taking absurdly large time.

Turns out that TX BD reclaim had a sublte bug.

Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out.

[ARCLinux]$ ls -l -sh /disk/log.txt
17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt

========== Before =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    31m 7.95s
user    0m 0.00s
sys     0m 0.10s

========== After =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    0m 24.33s
user    0m 0.00s
sys     0m 0.19s
Cc Alexey Brodkin <[email protected]> (commit_signer:3/4=75%)
Cc "David S. Miller" <[email protected]> (commit_signer:3/4=75%)
---
 drivers/net/ethernet/arc/emac_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/arc/emac_main.c +2 -2
index 55d79cb..9e16014 100644
@@ -149,8 +149,6 @@ static void arc_emac_tx_clean(struct net_device *ndev)
 		struct sk_buff *skb = tx_buff->skb;
 		unsigned int info = le32_to_cpu(txbd->info);
 
-		*txbd_dirty = (*txbd_dirty + 1) % TX_BD_NUM;
-
 		if ((info & FOR_EMAC) || !txbd->data)
 			break;
 
@@ -180,6 +178,8 @@ static void arc_emac_tx_clean(struct net_device *ndev)
 		txbd->data = 0;
 		txbd->info = 0;
 
+		*txbd_dirty = (*txbd_dirty + 1) % TX_BD_NUM;
+
 		if (netif_queue_stopped(ndev))
 			netif_wake_queue(ndev);
 	}
Signature · 1 line
1.8.1.2
maintainer Applied
#1 lore raw

From: Vineet Gupta <[email protected]>
Date: Wed, 4 Sep 2013 17:17:15 +0530

Quoted 20 lines

copying large files to a NFS mounted host was taking absurdly large time.

Turns out that TX BD reclaim had a sublte bug.

Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out.

[ARCLinux]$ ls -l -sh /disk/log.txt
17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt

========== Before =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    31m 7.95s
user    0m 0.00s
sys     0m 0.10s
Quoted 7 lines

========== After =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    0m 24.33s
user    0m 0.00s
sys     0m 0.19s

Applied.

#2 lore raw
Quoted 29 lines · David Miller

From: Vineet Gupta <[email protected]>
Date: Wed, 4 Sep 2013 17:17:15 +0530

Quoted 26 lines

copying large files to a NFS mounted host was taking absurdly large time.

Turns out that TX BD reclaim had a sublte bug.

Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out.

[ARCLinux]$ ls -l -sh /disk/log.txt
17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt

========== Before =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    31m 7.95s
user    0m 0.00s
sys     0m 0.10s

========== After =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    0m 24.33s
user    0m 0.00s
sys     0m 0.19s
Quoted 4 lines
Quoted 1 line

Applied.

Hi Greg,

This needs a stable backport (3.11).
Mainline commit 27082ee1b92f4d41e78b85

Thx,
-Vineet

#3 lore raw
Quoted 35 lines · Vineet Gupta
Quoted 29 lines · David Miller

From: Vineet Gupta <[email protected]>
Date: Wed, 4 Sep 2013 17:17:15 +0530

Quoted 26 lines

copying large files to a NFS mounted host was taking absurdly large time.

Turns out that TX BD reclaim had a sublte bug.

Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out.

[ARCLinux]$ ls -l -sh /disk/log.txt
17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt

========== Before =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    31m 7.95s
user    0m 0.00s
sys     0m 0.10s

========== After =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    0m 24.33s
user    0m 0.00s
sys     0m 0.19s
Quoted 4 lines
Quoted 1 line

Applied.

Quoted 7 lines

Hi Greg,

This needs a stable backport (3.11).
Mainline commit 27082ee1b92f4d41e78b85

Thx,
-Vineet

Hi Greg,

I didn't spot this one in your stable-queue for 3.11. Please apply.

Thx,
Vineet

#4 lore raw
Quoted 41 lines · Vineet Gupta
Quoted 40 lines · Vineet Gupta
Quoted 29 lines · David Miller

From: Vineet Gupta <[email protected]>
Date: Wed, 4 Sep 2013 17:17:15 +0530

Quoted 26 lines

copying large files to a NFS mounted host was taking absurdly large time.

Turns out that TX BD reclaim had a sublte bug.

Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out.

[ARCLinux]$ ls -l -sh /disk/log.txt
17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt

========== Before =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    31m 7.95s
user    0m 0.00s
sys     0m 0.10s

========== After =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    0m 24.33s
user    0m 0.00s
sys     0m 0.19s
Quoted 4 lines
Quoted 1 line

Applied.

Hi Greg,

This needs a stable backport (3.11).
Mainline commit 27082ee1b92f4d41e78b85

Quoted 7 lines
Quoted 2 lines

Thx,
-Vineet

Hi Greg,

I didn't spot this one in your stable-queue for 3.11. Please apply.

Network patches for the stable tree needs to go through the networking maintainer. Please let them know about this and they will forward it on to me if needed.

thanks,

greg k-h

#5 lore raw
Quoted 46 lines · greg Kroah-Hartman
Quoted 39 lines · Vineet Gupta
Quoted 38 lines · Vineet Gupta
Quoted 23 lines · David Miller

From: Vineet Gupta <[email protected]>
Date: Wed, 4 Sep 2013 17:17:15 +0530

Quoted 20 lines

copying large files to a NFS mounted host was taking absurdly large time.

Turns out that TX BD reclaim had a sublte bug.

Loop starts off from @txbd_dirty cursor and stops when it hits a BD still in use by controller. However when it stops it needs to keep the cursor at that very BD to resume scanning in next iteration. However it was erroneously incrementing the cursor, causing the next scan(s) to fail too, unless the BD chain was completely drained out.

[ARCLinux]$ ls -l -sh /disk/log.txt
17976 -rw-r--r-- 1 root root 17.5M Sep /disk/log.txt

========== Before =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    31m 7.95s
user    0m 0.00s
sys     0m 0.10s
Quoted 9 lines
Quoted 7 lines

========== After =====================
[ARCLinux]$ time cp /disk/log.txt /mnt/.

real    0m 24.33s
user    0m 0.00s
sys     0m 0.19s

Applied.

Hi Greg,

This needs a stable backport (3.11).
Mainline commit 27082ee1b92f4d41e78b85

Quoted 6 lines
Quoted 2 lines

Thx,
-Vineet

Hi Greg,

I didn't spot this one in your stable-queue for 3.11. Please apply.

Quoted 7 lines

Network patches for the stable tree needs to go through the networking maintainer. Please let them know about this and they will forward it on to me if needed.

thanks,

greg k-h

Hi David,

Can you please do the needful for stable 3.11 backport of this patch.

Thx,
-Vineet

maintainer
#6 lore raw

From: Vineet Gupta <[email protected]>
Date: Tue, 17 Sep 2013 04:07:23 +0000

Quoted 1 line

Can you please do the needful for stable 3.11 backport of this patch.

Queued up for -stable.