linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* System stalls using usb-storage
@ 2003-07-24  3:00 Matthew Dharm
  2003-07-27  6:24 ` [linux-usb-devel] " Oliver Neukum
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Dharm @ 2003-07-24  3:00 UTC (permalink / raw)
  To: USB Developers, Kernel Developer List

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

Many people, including myself, have observed system stalls when using
usb-storage.  It happens when copying large amounts of data to a USB device
-- everything (except the USB access) just stops for a little while.  My
best guess is that the block cache is filling up (easy since USB is so
slow).

The question is, what is the best way to handle this.  I'm guessing that
increasing the priority of the usb-storage control thread will help, but
that's just a guess.  I'm not even sure how to go about doing that, tho...

This is seen on 2.4 and 2.5/6 kernels.

Anyone have any ideas?

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

M:  No, Windows doesn't have any nag screens.
C:  Then what are those blue and white screens I get every day?
					-- Mike and Cobb
User Friendly, 1/4/1999

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-usb-devel] System stalls using usb-storage
  2003-07-24  3:00 System stalls using usb-storage Matthew Dharm
@ 2003-07-27  6:24 ` Oliver Neukum
  2003-07-27  6:35   ` Matthew Dharm
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Neukum @ 2003-07-27  6:24 UTC (permalink / raw)
  To: Matthew Dharm, USB Developers, Kernel Developer List

Am Donnerstag, 24. Juli 2003 05:00 schrieb Matthew Dharm:
> Many people, including myself, have observed system stalls when using
> usb-storage.  It happens when copying large amounts of data to a USB device
> -- everything (except the USB access) just stops for a little while.  My
> best guess is that the block cache is filling up (easy since USB is so
> slow).

Can you do a vmstat run? That should provide conclusive data.
If so, write throteling is failing.

> The question is, what is the best way to handle this.  I'm guessing that
> increasing the priority of the usb-storage control thread will help, but
> that's just a guess.  I'm not even sure how to go about doing that, tho...

A kernel thread in the block io path has to have a higher priority than
any user task. Otherwise a priority inversion is possible.

	Regards
		Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-usb-devel] System stalls using usb-storage
  2003-07-27  6:24 ` [linux-usb-devel] " Oliver Neukum
@ 2003-07-27  6:35   ` Matthew Dharm
  2003-07-27  9:09     ` Peter Osterlund
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Dharm @ 2003-07-27  6:35 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: USB Developers, Kernel Developer List

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

On Sun, Jul 27, 2003 at 08:24:44AM +0200, Oliver Neukum wrote:
> Am Donnerstag, 24. Juli 2003 05:00 schrieb Matthew Dharm:
> > Many people, including myself, have observed system stalls when using
> > usb-storage.  It happens when copying large amounts of data to a USB device
> > -- everything (except the USB access) just stops for a little while.  My
> > best guess is that the block cache is filling up (easy since USB is so
> > slow).
> 
> Can you do a vmstat run? That should provide conclusive data.
> If so, write throteling is failing.

I'll set up some tests and get back to you...

> > The question is, what is the best way to handle this.  I'm guessing that
> > increasing the priority of the usb-storage control thread will help, but
> > that's just a guess.  I'm not even sure how to go about doing that, tho...
> 
> A kernel thread in the block io path has to have a higher priority than
> any user task. Otherwise a priority inversion is possible.

Reasonable.  So, other than renice at the command line, how does one go
about setting this?

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Somebody call an exorcist!
					-- Dust Puppy
User Friendly, 5/16/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-usb-devel] System stalls using usb-storage
  2003-07-27  6:35   ` Matthew Dharm
@ 2003-07-27  9:09     ` Peter Osterlund
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Osterlund @ 2003-07-27  9:09 UTC (permalink / raw)
  To: Matthew Dharm; +Cc: Oliver Neukum, USB Developers, Kernel Developer List

Matthew Dharm <mdharm-kernel@one-eyed-alien.net> writes:

> On Sun, Jul 27, 2003 at 08:24:44AM +0200, Oliver Neukum wrote:
> > Am Donnerstag, 24. Juli 2003 05:00 schrieb Matthew Dharm:
> > > The question is, what is the best way to handle this.  I'm guessing that
> > > increasing the priority of the usb-storage control thread will help, but
> > > that's just a guess.  I'm not even sure how to go about doing that, tho...
> > 
> > A kernel thread in the block io path has to have a higher priority than
> > any user task. Otherwise a priority inversion is possible.
> 
> Reasonable.  So, other than renice at the command line, how does one go
> about setting this?

Try this patch. The loop device thread is doing the same thing.

diff -puN drivers/usb/storage/usb.c~usb-priority drivers/usb/storage/usb.c
--- linux/drivers/usb/storage/usb.c~usb-priority	Sun Jul 27 10:56:02 2003
+++ linux-petero/drivers/usb/storage/usb.c	Sun Jul 27 10:56:47 2003
@@ -302,6 +302,8 @@ static int usb_stor_control_thread(void 
 
 	current->flags |= PF_IOTHREAD;
 
+	set_user_nice(current, -20);
+
 	unlock_kernel();
 
 	/* signal that we've started the thread */

-- 
Peter Osterlund - petero2@telia.com
http://w1.894.telia.com/~u89404340

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-27  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-24  3:00 System stalls using usb-storage Matthew Dharm
2003-07-27  6:24 ` [linux-usb-devel] " Oliver Neukum
2003-07-27  6:35   ` Matthew Dharm
2003-07-27  9:09     ` Peter Osterlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).