lkml.org 
[lkml]   [2004]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: USB hangs
Where is USB kmalloc'ing with GFP_KERNEL?  I thought we tracked all those
down and eliminated them.

Matt

On Sun, Jan 11, 2004 at 12:07:17AM +0000, Alan Cox wrote:
> 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.
>

> --- 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();
>


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

Your lips are twitching. You're playing Quake aren't you.
-- Stef to Greg
User Friendly, 8/11/1998
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:59    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site