Re: [PATCH] async scsi scanning, version 11

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

 



On Sun, Sep 24, 2006 at 03:43:45PM -0400, Dave Jones wrote:
> On Sun, Sep 24, 2006 at 01:06:24PM -0600, Matthew Wilcox wrote:
>  > +
>  > +int scsi_complete_async_scans(void)
>  > +{
>  > +	struct async_scan_data *data;
>  > +
>  > +	do {
>  > +		if (list_empty(&scanning_hosts))
>  > +			return 0;
>  > +		data = kmalloc(sizeof(*data), GFP_KERNEL);
>  > +		if (!data)
>  > +			msleep(1);
>  > +	} while (!data);
> 
> does __GFP_NOFAIL or __GFP_REPEAT have the desired effect here? 

Well ... that would probably be OK.  But I think it's actually preferable
to not use it.  See, the scan might finish while we're waiting for
memory, and if it does, then we don't need to allocate memory after all.
This is totally quibbling over the most unlikely of scenarios though,
so I have no problem with making the change if we just want to exemplify
best practice here.

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux