public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Phylib polling when doing mdio_read will cause system response and transfer speed drop
@ 2010-04-14  0:27 Bryan Wu
  2010-04-19  7:21 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Wu @ 2010-04-14  0:27 UTC (permalink / raw)
  To: afleming, davem; +Cc: netdev, LKML

Hi Andy and David,

After I posted a patch to add phylib supporting in drivers/net/fec.c, we found 
performance drop regressions on Freescale i.MX51 babbage board.

Patch is 
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=e6b043d512fa8d9a3801bf5d72bfa3b8fc3b3cc8.

Bug tracker is here: 
https://bugs.launchpad.net/ubuntu/+source/linux-fsl-imx51/+bug/546649

I found the root cause is the polling operation in the mdio_read function. When 
we transfer large files, we experienced many times of timeout issue. So I got 
several question here:
1. Need I return -ETIMEDOUT when polling timeout. If I don't return -ETIMEOUT, 
the performance improved a lot. And after check other drivers, some don't return 
anything, some return 0, some return negative value. What's the rule for this 
mdio_read polling timeout case.

2. How to do polling busy waiting? Normally, we won't buys wait very long in 
polling. But hardware is not perfect every time. Running cpu_relax() 10000 times 
in polling will cause our system response very bad when hardware don't set the 
flag as we expected. Maybe udelay(25) 10 times or msleep(1) 10 times is better 
than that.

I got a patch to recover this issue, 
http://kernel.ubuntu.com/git?p=roc/ubuntu-lucid.git;a=commitdiff;h=5d77e3409b319ca84183bf1d2fd158a9c864e03f.

Thanks a lot,
-- 
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer    +86.138-1617-6545 Mobile
Ubuntu Kernel Team | Hardware Enablement Team
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Phylib polling when doing mdio_read will cause system response and transfer speed drop
  2010-04-14  0:27 Phylib polling when doing mdio_read will cause system response and transfer speed drop Bryan Wu
@ 2010-04-19  7:21 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2010-04-19  7:21 UTC (permalink / raw)
  To: Bryan Wu; +Cc: afleming, davem, netdev, LKML

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

On Tue, Apr 13, 2010 at 05:27:33PM -0700, Bryan Wu wrote:

> I found the root cause is the polling operation in the mdio_read 
> function. When we transfer large files, we experienced many times of 
> timeout issue. So I got several question here:

Same here, I saw the 'MDIO Timeout' Message occasionally.

> 1. Need I return -ETIMEDOUT when polling timeout. If I don't return 
> -ETIMEOUT, the performance improved a lot. And after check other drivers, 
> some don't return anything, some return 0, some return negative value. 
> What's the rule for this mdio_read polling timeout case.
>
> 2. How to do polling busy waiting? Normally, we won't buys wait very long 
> in polling. But hardware is not perfect every time. Running cpu_relax() 
> 10000 times in polling will cause our system response very bad when 
> hardware don't set the flag as we expected. Maybe udelay(25) 10 times or 
> msleep(1) 10 times is better than that.
>
> I got a patch to recover this issue,  
> http://kernel.ubuntu.com/git?p=roc/ubuntu-lucid.git;a=commitdiff;h=5d77e3409b319ca84183bf1d2fd158a9c864e03f.

Can't help with the details, but the patch seems to help here, too
(and not only because of the removed printk ;)).

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-19  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14  0:27 Phylib polling when doing mdio_read will cause system response and transfer speed drop Bryan Wu
2010-04-19  7:21 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox