On Tue, 25 Apr 2006, Christian Haul wrote:

> Hi all,
> 
> I've recently noticed a problem with extremely high system load on my
> debian sid system. I first tracked it down to the usb_storage kernel
> module ie removing the module fixes the problem. Now, I get the
> impression that hald triggers the
> problem by continuesly polling the card reader device.
> I've compiled the usb module with debug on and the following shows up in
> /var/log/debug:
> 
> Apr 22 23:16:51 polo kernel: usb-storage: queuecommand called
> Apr 22 23:16:51 polo kernel: usb-storage: *** thread awakened.
> Apr 22 23:16:51 polo kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
> Apr 22 23:16:51 polo kernel: usb-storage:  00 00 00 00 00 00
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk Command S 0x43425355 T
> 0x128c3 L 0 F 0 Trg 0 LUN 0 CL 6
> Apr 22 23:16:51 polo kernel: usb-storage: usb_stor_bulk_transfer_buf:
> xfer 31 bytes
> Apr 22 23:16:51 polo kernel: usb-storage: Status code 0; transferred 31/31
> Apr 22 23:16:51 polo kernel: usb-storage: -- transfer complete
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk command transfer result=0
> Apr 22 23:16:51 polo kernel: usb-storage: Attempting to get CSW...
> Apr 22 23:16:51 polo kernel: usb-storage: usb_stor_bulk_transfer_buf:
> xfer 13 bytes
> Apr 22 23:16:51 polo kernel: usb-storage: Status code 0; transferred 13/13
> Apr 22 23:16:51 polo kernel: usb-storage: -- transfer complete
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk status result = 0
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk Status S 0x53425355 T
> 0x128c3 R 0 Stat 0x1
> Apr 22 23:16:51 polo kernel: usb-storage: -- transport indicates command
> failure
> Apr 22 23:16:51 polo kernel: usb-storage: Issuing auto-REQUEST_SENSE
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk Command S 0x43425355 T
> 0x128c4 L 18 F 128 Trg 0 LUN 0 CL 6
> Apr 22 23:16:51 polo kernel: usb-storage: usb_stor_bulk_transfer_buf:
> xfer 31 bytes
> Apr 22 23:16:51 polo kernel: usb-storage: Status code 0; transferred 31/31
> Apr 22 23:16:51 polo kernel: usb-storage: -- transfer complete
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk command transfer result=0
> Apr 22 23:16:51 polo kernel: usb-storage: usb_stor_bulk_transfer_buf:
> xfer 18 bytes
> Apr 22 23:16:51 polo kernel: usb-storage: Status code 0; transferred 18/18
> Apr 22 23:16:51 polo kernel: usb-storage: -- transfer complete
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk data transfer result 0x0
> Apr 22 23:16:51 polo kernel: usb-storage: Attempting to get CSW...
> Apr 22 23:16:51 polo kernel: usb-storage: usb_stor_bulk_transfer_buf:
> xfer 13 bytes
> Apr 22 23:16:51 polo kernel: usb-storage: Status code 0; transferred 13/13
> Apr 22 23:16:51 polo kernel: usb-storage: -- transfer complete
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk status result = 0
> Apr 22 23:16:51 polo kernel: usb-storage: Bulk Status S 0x53425355 T
> 0x128c4 R 0 Stat 0x0
> Apr 22 23:16:51 polo kernel: usb-storage: -- Result from auto-sense is 0
> Apr 22 23:16:51 polo kernel: usb-storage: -- code: 0x70, key: 0x2, ASC:
> 0x3a, ASCQ: 0x0
> Apr 22 23:16:51 polo kernel: usb-storage: Not Ready: Medium not present
> Apr 22 23:16:51 polo kernel: usb-storage: scsi cmd done, result=0x2
> Apr 22 23:16:51 polo kernel: usb-storage: *** thread sleeping.
> 
> This block repeats for every 2 seconds..... and top shows around CPU 40% hi

I have trouble believing that a few milliseconds of activity occurring 
once every two seconds is enough to push your CPU usage to 40%.

> This is what I got from [EMAIL PROTECTED] :
> 
> > We need to poll otherwise we can't do media detection. The kernel driver
> > needs to be fixed, suggest to write mail to one of the kernel lists
> > detailing the problem.

They're right about the polling, but they're wrong about the kernel driver
needing to be fixed.  In fact nothing needs to be fixed as far as I can
see, except possibly the statistics you get from top.  Have you tried
experimenting with a real load present, such as running a benchmark
program?  Try to find out how much hald and usb-storage really do slow 
down performance.

On the other hand, if you _really_ object to the extra load, you can 
simply turn off hald.  Or rmmod usb-storage.

Alan Stern



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to