* [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory
@ 2005-11-30 17:15 Dan Aloni
2005-11-30 19:33 ` Luke-Jr
0 siblings, 1 reply; 6+ messages in thread
From: Dan Aloni @ 2005-11-30 17:15 UTC (permalink / raw)
To: Marcelo; +Cc: Linux Kernel List
Emulated scsi hosts don't do DMA, so don't unnecessarily increase
the SCSI DMA pool.
Signed-off-by: Dan Aloni <da-x@monatomic.org>
---
commit 8f6409c7c270038ca4d154551e061f66a9580301
tree ab7fedd2e7dbaefe31c332fc487f45a005972571
parent a0837aece47b79a2bfd524e70e4f8a559c743c4c
author Dan Aloni <da-x@monatomic.org> Wed, 30 Nov 2005 18:14:11 +0200
committer Dan Aloni <da-x@monatomic.org> Wed, 30 Nov 2005 18:14:11 +0200
drivers/scsi/scsi_dma.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/scsi_dma.c b/drivers/scsi/scsi_dma.c
index 5594828..52737d6 100644
--- a/drivers/scsi/scsi_dma.c
+++ b/drivers/scsi/scsi_dma.c
@@ -231,10 +231,17 @@ void scsi_resize_dma_pool(void)
need_isa_bounce_buffers = 0;
if (scsi_devicelist)
- for (shpnt = scsi_hostlist; shpnt; shpnt = shpnt->next)
+ for (shpnt = scsi_hostlist; shpnt; shpnt = shpnt->next) {
+ if (shpnt->hostt->emulated)
+ continue;
+
new_dma_sectors += SECTORS_PER_PAGE; /* Increment for each host */
+ }
for (host = scsi_hostlist; host; host = host->next) {
+ if (host->hostt->emulated)
+ continue;
+
for (SDpnt = host->host_queue; SDpnt; SDpnt = SDpnt->next) {
/*
* sd and sr drivers allocate scatterlists.
--
Dan Aloni
da-x@monatomic.org, da-x@colinux.org, da-x@gmx.net
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory
2005-11-30 17:15 [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory Dan Aloni
@ 2005-11-30 19:33 ` Luke-Jr
2005-11-30 21:02 ` Dan Aloni
0 siblings, 1 reply; 6+ messages in thread
From: Luke-Jr @ 2005-11-30 19:33 UTC (permalink / raw)
To: Linux Kernel Mailing List
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?
--
Luke-Jr
Developer, Utopios
http://utopios.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory
2005-11-30 19:33 ` Luke-Jr
@ 2005-11-30 21:02 ` Dan Aloni
2005-12-01 11:36 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Dan Aloni @ 2005-11-30 21:02 UTC (permalink / raw)
To: Luke-Jr; +Cc: Linux Kernel Mailing List
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.
--
Dan Aloni
da-x@monatomic.org, da-x@colinux.org, da-x@gmx.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory
2005-11-30 21:02 ` Dan Aloni
@ 2005-12-01 11:36 ` Christoph Hellwig
2005-12-01 15:39 ` Dan Aloni
2005-12-21 18:17 ` Marcelo Tosatti
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Hellwig @ 2005-12-01 11:36 UTC (permalink / raw)
To: Dan Aloni; +Cc: Luke-Jr, Linux Kernel Mailing List
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)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory
2005-12-01 11:36 ` Christoph Hellwig
@ 2005-12-01 15:39 ` Dan Aloni
2005-12-21 18:17 ` Marcelo Tosatti
1 sibling, 0 replies; 6+ messages in thread
From: Dan Aloni @ 2005-12-01 15:39 UTC (permalink / raw)
To: Christoph Hellwig, Luke-Jr, Linux Kernel Mailing List
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@monatomic.org, da-x@colinux.org, da-x@gmx.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory
2005-12-01 11:36 ` Christoph Hellwig
2005-12-01 15:39 ` Dan Aloni
@ 2005-12-21 18:17 ` Marcelo Tosatti
1 sibling, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2005-12-21 18:17 UTC (permalink / raw)
To: Christoph Hellwig, Dan Aloni, Luke-Jr, Linux Kernel Mailing List
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)
Agreed - this does not sound like a critical bug fix to me.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-12-21 18:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-30 17:15 [PATCH 2.4.x] prevent emulated SCSI hosts from wasting DMA memory Dan Aloni
2005-11-30 19:33 ` Luke-Jr
2005-11-30 21:02 ` Dan Aloni
2005-12-01 11:36 ` Christoph Hellwig
2005-12-01 15:39 ` Dan Aloni
2005-12-21 18:17 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox