diff mbox

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

Message ID 1378295235-18928-1-git-send-email-vgupta@synopsys.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Vineet Gupta Sept. 4, 2013, 11:47 a.m. UTC
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

Comments

David Miller Sept. 5, 2013, 6:25 p.m. UTC | #1
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Date: Wed, 4 Sep 2013 17:17:15 +0530

> 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
> 
> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vineet Gupta Sept. 10, 2013, 6:27 a.m. UTC | #2
On 09/05/2013 11:55 PM, David Miller wrote:
> From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
> Date: Wed, 4 Sep 2013 17:17:15 +0530
> 
>> 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
>>
>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> 
> Applied.
> 

Hi Greg,

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

Thx,
-Vineet

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vineet Gupta Sept. 16, 2013, 5:43 a.m. UTC | #3
On 09/10/2013 11:57 AM, Vineet Gupta wrote:
> On 09/05/2013 11:55 PM, David Miller wrote:
>> From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
>> Date: Wed, 4 Sep 2013 17:17:15 +0530
>>
>>> 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
>>>
>>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>>
>> Applied.
>>
> 
> 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



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman Sept. 16, 2013, 7:40 p.m. UTC | #4
On Mon, Sep 16, 2013 at 11:13:48AM +0530, Vineet Gupta wrote:
> On 09/10/2013 11:57 AM, Vineet Gupta wrote:
> > On 09/05/2013 11:55 PM, David Miller wrote:
> >> From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
> >> Date: Wed, 4 Sep 2013 17:17:15 +0530
> >>
> >>> 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
> >>>
> >>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
> >>
> >> Applied.
> >>
> > 
> > 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.

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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vineet Gupta Sept. 17, 2013, 4:07 a.m. UTC | #5
On 09/17/2013 01:10 AM, greg Kroah-Hartman wrote:
> On Mon, Sep 16, 2013 at 11:13:48AM +0530, Vineet Gupta wrote:
>> On 09/10/2013 11:57 AM, Vineet Gupta wrote:
>>> On 09/05/2013 11:55 PM, David Miller wrote:
>>>> From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
>>>> Date: Wed, 4 Sep 2013 17:17:15 +0530
>>>>
>>>>> 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
>>>>>
>>>>> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
>>>> Applied.
>>>>
>>> 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.
> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 17, 2013, 4:17 a.m. UTC | #6
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Date: Tue, 17 Sep 2013 04:07:23 +0000

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

Queued up for -stable.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

========== 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

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com> (commit_signer:3/4=75%)
Cc: "David S. Miller" <davem@davemloft.net> (commit_signer:3/4=75%)
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: arc-linux-dev@synopsys.com
---
 drivers/net/ethernet/arc/emac_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index 55d79cb..9e16014 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -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);
 	}