9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] usb ohci testing
@ 2011-09-01 10:11 Richard Miller
  2011-09-01 16:25 ` cinap_lenrek
  2011-09-01 16:47 ` cinap_lenrek
  0 siblings, 2 replies; 13+ messages in thread
From: Richard Miller @ 2011-09-01 10:11 UTC (permalink / raw)
  To: 9fans

I have a small experimental change to /sys/src/9/pc/usbohci.c which
is needed to get my macbook's built-in bluetooth working with Plan 9
under virtualbox.  As a pleasing side effect, it speeds up reading of
usb1.0 flash disks by about a factor of ten.

Before submitting a patch I want to check that it also works on native
Plan 9, but I don't have suitable hardware.  Would someone running
native Plan 9 on a motherboard with an ohci host adapter like to help,
by building a kernel with the usbohci.c from /n/sources/contrib/miller,
testing that any usb1.0 devices still work, and measuring usb disk speed
before and after with something like:
  time dd -if /dev/sdU0.0/data -of /dev/null -bs 64k -count 16

Note that usb2.0 devices should not be affected by the change, because
they will be handled by the usbehci.c driver.  You can use usb/probe
to check which usb driver (uhci, ohci, ehci) is handling each plugged-in
device.

In theory you can force usb2.0 devices to be handled by ohci as well,
by setting *nousbehci=1 in plan9.ini to disable the ehci driver.  This
doesn't work for me on virtualbox (which gets thoroughly wedged when I
attach a usb2.0 flash drive), but it might work on real hardware.




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

* Re: [9fans] usb ohci testing
  2011-09-01 10:11 [9fans] usb ohci testing Richard Miller
@ 2011-09-01 16:25 ` cinap_lenrek
  2011-09-01 16:40   ` erik quanstrom
  2011-09-01 16:42   ` cinap_lenrek
  2011-09-01 16:47 ` cinap_lenrek
  1 sibling, 2 replies; 13+ messages in thread
From: cinap_lenrek @ 2011-09-01 16:25 UTC (permalink / raw)
  To: 9fans

will try as soon as possible.

as far as i can see that patch limits the packet size for
the transfers to 8K no?

any insights on why this has such an dramatic impact on
performance?

--
cinap



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

* Re: [9fans] usb ohci testing
  2011-09-01 16:25 ` cinap_lenrek
@ 2011-09-01 16:40   ` erik quanstrom
  2011-09-01 16:42   ` cinap_lenrek
  1 sibling, 0 replies; 13+ messages in thread
From: erik quanstrom @ 2011-09-01 16:40 UTC (permalink / raw)
  To: cinap_lenrek, 9fans

On Thu Sep  1 12:27:31 EDT 2011, cinap_lenrek@gmx.de wrote:
> will try as soon as possible.
>
> as far as i can see that patch limits the packet size for
> the transfers to 8K no?

since each frame is 1ms, it would take a 64Mbit line rate
to deliver 8k/frame.  since by definition we're talking about
usb1.1, i don't see how you could get >8k/frame.

actually, i'm not sure how we could get over 4k/frame since
32Mbit >> 12Mbit.

> any insights on why this has such an dramatic impact on
> performance?

paging in a virtual environment is teh suck without hardware assist.

- erik



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

* Re: [9fans] usb ohci testing
  2011-09-01 16:25 ` cinap_lenrek
  2011-09-01 16:40   ` erik quanstrom
@ 2011-09-01 16:42   ` cinap_lenrek
  1 sibling, 0 replies; 13+ messages in thread
From: cinap_lenrek @ 2011-09-01 16:42 UTC (permalink / raw)
  To: 9fans

> as far as i can see that patch limits the packet size for
> the transfers to 8K no?

correction, that was WRONG...

--
cinap



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

* Re: [9fans] usb ohci testing
  2011-09-01 10:11 [9fans] usb ohci testing Richard Miller
  2011-09-01 16:25 ` cinap_lenrek
@ 2011-09-01 16:47 ` cinap_lenrek
  2011-09-01 16:55   ` Richard Miller
  1 sibling, 1 reply; 13+ messages in thread
From: cinap_lenrek @ 2011-09-01 16:47 UTC (permalink / raw)
  To: 9fans

0.00u 0.00s 0.39r

--
cinap



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

* Re: [9fans] usb ohci testing
  2011-09-01 16:47 ` cinap_lenrek
@ 2011-09-01 16:55   ` Richard Miller
  2011-09-01 17:23     ` cinap_lenrek
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Miller @ 2011-09-01 16:55 UTC (permalink / raw)
  To: 9fans

> 0.00u 0.00s 0.39r

How does this compare with the old kernel on your hardware?




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

* Re: [9fans] usb ohci testing
  2011-09-01 16:55   ` Richard Miller
@ 2011-09-01 17:23     ` cinap_lenrek
  2011-09-01 17:55       ` Richard Miller
  0 siblings, 1 reply; 13+ messages in thread
From: cinap_lenrek @ 2011-09-01 17:23 UTC (permalink / raw)
  To: 9fans

its mostly the same.

without the patch, i get the same realtime
but system time is 0.01.

i retried with 1024 blocks, there i get 27
seconds realtime. with the patch, its 25
seconds.

--
cinap



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

* Re: [9fans] usb ohci testing
  2011-09-01 17:23     ` cinap_lenrek
@ 2011-09-01 17:55       ` Richard Miller
  2011-09-01 18:22         ` cinap_lenrek
  0 siblings, 1 reply; 13+ messages in thread
From: Richard Miller @ 2011-09-01 17:55 UTC (permalink / raw)
  To: 9fans

> i retried with 1024 blocks, there i get 27
> seconds realtime. with the patch, its 25
> seconds.

I think you're looking at a high-speed (usbehci) device.

1024 x 64kbyte blocks in 25 seconds is
  1024*64*1024*8/25 = 21474836.48 bit/second

usbohci (full-speed) is 12 megabit/sec maximum.




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

* Re: [9fans] usb ohci testing
  2011-09-01 17:55       ` Richard Miller
@ 2011-09-01 18:22         ` cinap_lenrek
  2011-09-01 18:50           ` Richard Miller
  0 siblings, 1 reply; 13+ messages in thread
From: cinap_lenrek @ 2011-09-01 18:22 UTC (permalink / raw)
  To: 9fans

you are right. just guessed that this old usb pen drive
would not be usb 2.0.

with *nousbehci=1 the figures are different.

with patch: 2.7s
without patch: 3.8s

for 16 * 64k block read.

--
cinap



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

* Re: [9fans] usb ohci testing
  2011-09-01 18:22         ` cinap_lenrek
@ 2011-09-01 18:50           ` Richard Miller
  2011-09-02  5:06             ` erik quanstrom
  2011-09-02  8:48             ` cinap_lenrek
  0 siblings, 2 replies; 13+ messages in thread
From: Richard Miller @ 2011-09-01 18:50 UTC (permalink / raw)
  To: 9fans

> with patch: 2.7s
> without patch: 3.8s
>
> for 16 * 64k block read.

Thanks - I thought the big speedup might be a virtualisation artifact.
But it's useful to see I haven't broken ohci on real hardware.

Do you have any other devices (e.g. serial or ether adapters) you could
check it out with?




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

* Re: [9fans] usb ohci testing
  2011-09-01 18:50           ` Richard Miller
@ 2011-09-02  5:06             ` erik quanstrom
  2011-09-02  8:48             ` cinap_lenrek
  1 sibling, 0 replies; 13+ messages in thread
From: erik quanstrom @ 2011-09-02  5:06 UTC (permalink / raw)
  To: 9fans, 9fans

> Do you have any other devices (e.g. serial or ether adapters) you could
> check it out with?
>

the ancient apple kbd and the lenovo 3-button mouse i have
work just fine.

- erik



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

* Re: [9fans] usb ohci testing
  2011-09-01 18:50           ` Richard Miller
  2011-09-02  5:06             ` erik quanstrom
@ 2011-09-02  8:48             ` cinap_lenrek
  2011-09-02  8:51               ` Richard Miller
  1 sibling, 1 reply; 13+ messages in thread
From: cinap_lenrek @ 2011-09-02  8:48 UTC (permalink / raw)
  To: 9fans

ptp camera and usb ethernet work with your patch.

--
cinap



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

* Re: [9fans] usb ohci testing
  2011-09-02  8:48             ` cinap_lenrek
@ 2011-09-02  8:51               ` Richard Miller
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Miller @ 2011-09-02  8:51 UTC (permalink / raw)
  To: 9fans

Thanks, cinap & erik - I'll submit the patch.




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

end of thread, other threads:[~2011-09-02  8:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01 10:11 [9fans] usb ohci testing Richard Miller
2011-09-01 16:25 ` cinap_lenrek
2011-09-01 16:40   ` erik quanstrom
2011-09-01 16:42   ` cinap_lenrek
2011-09-01 16:47 ` cinap_lenrek
2011-09-01 16:55   ` Richard Miller
2011-09-01 17:23     ` cinap_lenrek
2011-09-01 17:55       ` Richard Miller
2011-09-01 18:22         ` cinap_lenrek
2011-09-01 18:50           ` Richard Miller
2011-09-02  5:06             ` erik quanstrom
2011-09-02  8:48             ` cinap_lenrek
2011-09-02  8:51               ` Richard Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).