Re: [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory

From: Dan Aloni
Date: Thu Dec 01 2005 - 10:37:42 EST


On Thu, Dec 01, 2005 at 11:36:10AM +0000, Christoph Hellwig wrote:
> On Wed, Nov 30, 2005 at 11:02:23PM +0200, Dan Aloni wrote:
> > On Wed, Nov 30, 2005 at 07:33:47PM +0000, Luke-Jr wrote:
> > > On Wednesday 30 November 2005 17:15, Dan Aloni wrote:
> > > > Emulated scsi hosts don't do DMA, so don't unnecessarily increase
> > > > the SCSI DMA pool.
> > >
> > > They don't? Recently I learned(?) that apparently using hdparm -d on the
> > > old /dev/hdX device still worked/applied when using ide-scsi... or do
> > > "emulated scsi hosts" refer to something else?
> >
> > Actually by 'do DMA' I meant use the scsi_malloc() interface - which
> > is mostly used by low level drivers. The IDE drivers allocate their
> > DMA memory outside the SCSI layer. iSCSI hosts for instance, don't
> > need to cause unnecessary DMA allocations.
>
> (1) there's no guranteee a driver setting ->emulated can't use scsi_malloc
> (2) 2.4.x is very late in the cycle so there's just no point in putting this
> in (and in 2.6.x scsi_malloc is gone fortunately)

(1) you're right, the SCSI subsystem itself uses scsi_malloc(). But I
wonder, would it be okay to simply replace scsi_malloc() invocations
with kmalloc of GFP_ATOMIC and GFP_DMA? I mean, to take the relevant
bits out of the 2.5.1-pre11 patch and give it a shot?

(2) you are right again, but fact is that 2.4.x is still being used
on some production systems for stability reasons (and also because
the SCSI kernel interfaces in 2.6.x weren't stabilized yet).

More specifically, I've made that patch to be able to connect to
a large number of iSCSI targets without problems. I wonder if
there's another way for doing that instead of upgrading to 2.6.x.

--
Dan Aloni
da-x@xxxxxxxxxxxxx, da-x@xxxxxxxxxxx, da-x@xxxxxxx
-
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/