Re: [PATCH 1/3] USB: use percpu counter to count submitted URBs per device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 19, 2013 at 07:04:18PM +0800, Ming Lei wrote:
> Because usb_hcd_submit_urb is in the hotest path of usb core,
> so use percpu counter to count URB instead of using atomic variable
> because atomic operations are much slower than percpu operations.
> 
> Cc: Oliver Neukum <oliver@xxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxxxxx>
> ---
>  drivers/usb/core/hcd.c   |    4 ++--
>  drivers/usb/core/sysfs.c |    7 ++++++-
>  drivers/usb/core/usb.c   |    9 ++++++++-
>  drivers/usb/core/usb.h   |    1 +
>  include/linux/usb.h      |    2 +-
>  5 files changed, 18 insertions(+), 5 deletions(-)

And this really speeds things up?  Exactly what does it?

And it's not that atomic operations are "slower", it's just that the
barriers involved can be slower, depending on what else is happening.
If you look, you are already hitting atomic variables in the same path,
so how can this change speed anything up?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux