public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* USB hangs
@ 2004-01-11  0:07 Alan Cox
  2004-01-11  0:23 ` Matthew Dharm
  2004-01-11 18:46 ` Lukas Postupa
  0 siblings, 2 replies; 25+ messages in thread
From: Alan Cox @ 2004-01-11  0:07 UTC (permalink / raw)
  To: Marcelo Tosatti, Linux Kernel Mailing List

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

With the various fixes people had been posting USB storage
writing was still hanging repeatedly when doing a 20Gb rsync
to usb-storage disks with a low memory system. Doing things
like while(true) sync() made it hang even more often.

After a bit of digging the following seems to fix it

Not sure if 2.6 needs this as well.

The failure path seems to be

	->scsi_done in the USB storage thread
	issues a new command
	causes USB to kmalloc GFP_KERNEL
	causes a page out
	queues a page out to the USB storage thread
	Deadlock.

Setting PF_MEMALLOC should stop the storage thread ever causing pageout
itself so deadlocking.


[-- Attachment #2: a1 --]
[-- Type: text/plain, Size: 335 bytes --]

--- drivers/usb/storage/usb.c~	2004-01-09 02:06:35.000000000 +0000
+++ drivers/usb/storage/usb.c	2004-01-09 02:06:35.000000000 +0000
@@ -332,6 +332,8 @@
 
 	/* set our name for identification purposes */
 	sprintf(current->comm, "usb-storage-%d", us->host_number);
+	
+	current->flags |= PF_MEMALLOC;
 
 	unlock_kernel();
 

^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re: [linux-usb-devel] Re: USB hangs
@ 2004-01-28 16:50 Martin Bogomolni
  0 siblings, 0 replies; 25+ messages in thread
From: Martin Bogomolni @ 2004-01-28 16:50 UTC (permalink / raw)
  To: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
On Mon 12 Jan, Oliver Neukum wrote:
 
[...]
 
ChangeSet@1.1218, 2004-01-12 00:26:13+01:00, oliver@vermuden.neukum.org -
avoid GFP_KERNEL in block IO path
 
[...]
 
Oliver, Alan, et. al.
 
I applied Oliver & Alan Cox's patches to the 2.4.24 kernel, and am still
seeing hangs when copying large amounts of data over USB on IBM systems
containing two EHCI controllers (Intel 82801EB).
 
I see similar errors to the ones Lucas Postupa had in the kernel logs :
 
Buffer I/O error on device sda1, logical block 134522 lost page write due to
I/O error on sda1
 
Unloading the EHCI driver, and reverting to 1.1 speeds, does not solve the issue.
 
- -Martin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
 
iD8DBQFAF+7vgZQNxll+EIcRAtkKAJ476IhZ+fLcyj73mDjNptU3rWmQ/ACeIIpz
M5S8ast+WlfEHhKrbAtuPg0=
=NH9l
-----END PGP SIGNATURE-----



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

end of thread, other threads:[~2004-01-28 17:18 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-11  0:07 USB hangs Alan Cox
2004-01-11  0:23 ` Matthew Dharm
2004-01-11  0:49   ` [linux-usb-devel] " Oliver Neukum
2004-01-11  1:01     ` Matthew Dharm
2004-01-11  1:06       ` Oliver Neukum
2004-01-11  1:40     ` David Brownell
2004-01-11  2:33   ` Alan Cox
2004-01-11  8:02     ` [linux-usb-devel] " Oliver Neukum
2004-01-11 22:39       ` Alan Cox
2004-01-11 23:29         ` Oliver Neukum
2004-01-12 15:53           ` Alan Stern
2004-01-11 23:25     ` David Brownell
2004-01-11 23:31       ` Matthew Dharm
2004-01-12  4:11         ` David Brownell
2004-01-12  7:39           ` Matthew Dharm
2004-01-12  8:37             ` Oliver Neukum
2004-01-12 16:27               ` Alan Stern
2004-01-12 20:56                 ` Alan Cox
2004-01-16 13:14                 ` Pavel Machek
2004-01-11 23:33       ` Oliver Neukum
2004-01-12  0:09         ` Alan Cox
2004-01-12  0:25           ` Matthew Dharm
2004-01-11 18:46 ` Lukas Postupa
2004-01-11 20:04   ` Matthew Dharm
  -- strict thread matches above, loose matches on Subject: below --
2004-01-28 16:50 [linux-usb-devel] " Martin Bogomolni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox