From: "Maksim (Max) Krasnyanskiy" <maxk@qualcomm.com>
To: Greg KH <greg@kroah.com>
Cc: Johannes Erdfelt <johannes@erdfelt.com>,
linux-kernel@vger.kernel.org,
linux-usb-devel@lists.sourceforge.net
Subject: Re: What to do with all of the USB UHCI drivers in the kernel ?
Date: Wed, 22 May 2002 12:43:09 -0700 [thread overview]
Message-ID: <5.1.0.14.2.20020522115749.06b888b0@mail1.qualcomm.com> (raw)
In-Reply-To: <20020522050640.GA646@kroah.com>
At 10:06 PM 5/21/2002 -0700, Greg KH wrote:
> > On a side note. Why are URBs still not SLABified ?
> > Drivers still have those silly urb pools and stuff. I thought you guys
> were
> > gonna fix that.
>
>It hasn't been proven that it's really needed. 95% of the current
>drivers create their urbs when the device is plugged in, and then free
>them when they are removed. Making that kind of allocation into a slab
>is a bit silly :)
Well, I'm claiming that those drivers are wrong ;)
It makes sense to pre-allocate intr in, iso and bulk in URB. But (imo) it
doesn't make much sense
to pre-allocate ctrl and bulk out. For example one might never send stuff
out of USB serial port,
because it used only for logging or something, ut write_urb will always be
allocated. Same
goes for ctrl, one sends ctrl requests only once in a while but URB is
always allocated.
Also as Dave pointed out kmalloc is already slabified anyway. And as I
mentioned kmalloc
has fixed size slabs and therefor will waste some memory.
>Now if more drivers start doing fun stuff like the visor.c driver does
>in the 2.5 tree, then it might make more sense to create a URB specific
>slab.
Some drivers are still maintaining bulk URB pools which is just unnecessary
code and mem waste.
They should allocate/free bulk urbs on demand.
visor, usbnet, hci_usb and some other driver allocate URB on demand.
I guess the reason for having driver specific URB pools is because
usb_alloc_urb (using kmalloc) was
slow. Now if it's replaced with slab cache it's no longer the case. So
drivers should not pre-allocate
stuff unnecessary.
It definitely doesn't hurt to have URB specific cache. You get better stats
(like URB slab utilization, etc).
You could chose to do slab poisoning and debug URB allocations and stuff.
You could use slab constructor
to pre-initialize some URB fields.
Max
next prev parent reply other threads:[~2002-05-22 19:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-21 19:41 Maksim (Max) Krasnyanskiy
2002-05-21 19:59 ` Greg KH
2002-05-21 20:43 ` Maksim (Max) Krasnyanskiy
2002-05-21 20:58 ` Johannes Erdfelt
2002-05-22 1:04 ` Maksim (Max) Krasnyanskiy
2002-05-22 4:33 ` [linux-usb-devel] " David Brownell
2002-05-22 18:57 ` Maksim (Max) Krasnyanskiy
2002-05-22 5:06 ` Greg KH
2002-05-22 19:43 ` Maksim (Max) Krasnyanskiy [this message]
2002-05-21 20:00 ` [linux-usb-devel] " Johannes Erdfelt
2002-05-21 21:09 ` Maksim (Max) Krasnyanskiy
-- strict thread matches above, loose matches on Subject: below --
2002-05-20 22:31 What to do with all of the USB UHCI drivers in the kernel? Greg KH
2002-05-21 15:23 ` [Linux-usb-users] " Timothy E. Jedlicka - wrk
2002-05-21 20:10 ` Greg KH
2002-05-22 1:10 ` André Bonin
2002-05-22 19:21 ` Greg KH
2002-05-22 19:35 ` Andre Bonin
2002-05-22 20:15 ` Greg KH
2002-05-23 6:34 ` Martin Dalecki
2002-05-23 17:41 ` Peter Osterlund
2002-05-23 17:48 ` Greg KH
2002-05-23 18:16 ` Peter Osterlund
2002-05-23 19:24 ` Pierre Rousselet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.1.0.14.2.20020522115749.06b888b0@mail1.qualcomm.com \
--to=maxk@qualcomm.com \
--cc=greg@kroah.com \
--cc=johannes@erdfelt.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®