On Wed, Sep 14, 2005 at 11:01:01PM -0400, Alan Stern wrote:
>
> This adds to sysfs all the information in /proc/bus/usb/devices _for the
> active configuration and the current altsettings_. There's nothing about
> the other configurations or altsettings, and of course we don't really
> want there to be.
>
> Your usb_{create|remove}_intf_ep_files routines are called whenever
> interfaces are created or destroyed. But you also need to call them
> whenever an altsetting is changed.
Hm, where is that? ugh, I'll go dig...
> Which causes difficulties, because in usb_remove_ep_files, it will no
> longer be safe to kfree all those data structures.
Why not? Those structures are only tied directly to the sysfs
representation of the endpoint. If they go away, the memory should be
freed.
> Unlike interfaces, altsettings aren't refcounted. All the altsettings
> for an interface are created/removed at the same time as the
> configuration (actually, the interface_cache).
>
> What is the overhead, in terms of memory usage, of creating all these
> structures for the sysfs attributes?
I added 3 pointers per endpoint, and an integer (which really might not
be needed, but I thought I'd be safe for now.) Those pointers expand
into a few small dynamically created structures (most of them are just
arrays of pointers.) So, the overhead might be about 64bytes or so per
endpoint in i386. Maybe a bit bigger, if I dig into the kmalloc memory.
The sysfs backend stuff should be pretty much "for free" as it can be
cached, and released, and reaped if not used and we get memory pressure.
thanks,
greg k-h
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel