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

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

 



Emulated scsi hosts don't do DMA, so don't unnecessarily increase
the SCSI DMA pool.

Signed-off-by: Dan Aloni <[email protected]>

---
commit 8f6409c7c270038ca4d154551e061f66a9580301
tree ab7fedd2e7dbaefe31c332fc487f45a005972571
parent a0837aece47b79a2bfd524e70e4f8a559c743c4c
author Dan Aloni <[email protected]> Wed, 30 Nov 2005 18:14:11 +0200
committer Dan Aloni <[email protected]> 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
[email protected], [email protected], [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux