Re: Fw: 2.6.6-rc3 ia64 smp_call_function() called with interrupts disabled

From: Christoph Hellwig
Date: Tue May 04 2004 - 04:43:57 EST


On Mon, May 03, 2004 at 09:35:13PM +0100, Matthew Wilcox wrote:
> That patch is crap -- it only frees the memory on the error path, not
> the normal exit. Since I got confused by this function, it struck me
> as not unreasonable that somebody else might also get confused by it
> and split it into two parts.
>
> I simplified some of the code. The old code took the lock, scanned
> through looking for a free slot, dropped the lock, allocated an sdp,
> grabbed the lock and checked the slot was still free, branching back
> if it had raced. This rewrite assumes that we will find a slot and
> allocates an sdp in advance.
>
> Does anybody like this patch? It survived booting on my test box which
> only has one scsi device. More testing welcomed.

Better than what was there, but I still don't like it. A global array
of devices is just utter crap. Every entry point from scsi already has
struct scsi_device from which we can derive the sg-specific portion easily,
and for anything else (from a quick look that seems to be only procfs
stuff which should fade out anyway) a linear search on a linked list
is okay.

btw, why are we vmalloc()ing Sg_device?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/