Re: The anchor patch critique

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Mittwoch, 6. Juni 2007 schrieb Pete Zaitcev:
> So, you add 24 bytes to all URBs, which are... not very thin, to be sure.
> Last time I counted they were 152 bytes apiece. Still, a 15% increase.
> I know you're a good algorithmist, are you sure you don't have any ideas?
> 
> The naive approach is to have anchor elements out of line... In a slab,
> since they are fixed-sized. What do you think?

Here's a patch to reduce padding:

--- a/include/linux/usb.h	2007-06-06 13:44:41.000000000 +0200
+++ b/include/linux/usb.h	2007-06-06 14:29:43.000000000 +0200
@@ -1142,24 +1142,24 @@ struct urb
 {
 	/* private: usb core and host controller only fields in the urb */
 	struct kref kref;		/* reference count of the URB */
+	atomic_t use_count;		/* concurrent submissions counter */
 	spinlock_t lock;		/* lock for the URB */
 	void *hcpriv;			/* private data for host controller */
-	atomic_t use_count;		/* concurrent submissions counter */
+	struct list_head anchor_list;	/* the URB may be anchored by the driver */
+	struct usb_anchor *anchor;	/* anchor to which we are chained */
 	u8 reject;			/* submissions will fail */
 
 	/* public: documented fields in the urb that can be used by drivers */
+	short status;			/* (return) non-ISO status */
+	unsigned short transfer_flags;	/* (in) URB_SHORT_NOT_OK | ...*/
+	unsigned int pipe;		/* (in) pipe information */
+	int transfer_buffer_length;	/* (in) data buffer length */
+	int actual_length;		/* (return) actual transfer length */
 	struct list_head urb_list;	/* list head for use by the urb's
 					 * current owner */
-	struct list_head anchor_list;	/* the URB may be anchored by the driver */
-	struct usb_anchor *anchor;
 	struct usb_device *dev; 	/* (in) pointer to associated device */
-	unsigned int pipe;		/* (in) pipe information */
-	int status;			/* (return) non-ISO status */
-	unsigned int transfer_flags;	/* (in) URB_SHORT_NOT_OK | ...*/
 	void *transfer_buffer;		/* (in) associated data buffer */
 	dma_addr_t transfer_dma;	/* (in) dma addr for transfer_buffer */
-	int transfer_buffer_length;	/* (in) data buffer length */
-	int actual_length;		/* (return) actual transfer length */
 	unsigned char *setup_packet;	/* (in) setup packet (control only) */
 	dma_addr_t setup_dma;		/* (in) dma addr for setup_packet */
 	int start_frame;		/* (modify) start frame (ISO) */

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.