summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-10-17 10:05:49 +0000
committerps <ps@FreeBSD.org>2000-10-17 10:05:49 +0000
commitc71ac689e04ce39d113325e3854477539dae464c (patch)
tree331cd4cbe2e1e3d9d7734fa4fce3e6a5554d434c /sys/cam
parent26207dd1489dfcba9ad2215401292904446e000a (diff)
downloadFreeBSD-src-c71ac689e04ce39d113325e3854477539dae464c.zip
FreeBSD-src-c71ac689e04ce39d113325e3854477539dae464c.tar.gz
Implement write combining for crashdumps. This is useful when
write caching is disabled on both SCSI and IDE disks where large memory dumps could take up to an hour to complete. Taking an i386 scsi based system with 512MB of ram and timing (in seconds) how long it took to complete a dump, the following results were obtained: Before: After: WCE TIME WCE TIME ------------------ ------------------ 1 141.820972 1 15.600111 0 797.265072 0 65.480465 Obtained from: Yahoo! Reviewed by: peter
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_da.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index cc5ada2..45d3d76 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -634,7 +634,9 @@ dadump(dev_t dev)
long blkcnt;
vm_offset_t addr;
struct ccb_scsiio csio;
+ int dumppages = MAXDUMPPGS;
int error;
+ int i;
/* toss any characters present prior to dump */
while (cncheckc() != -1)
@@ -659,12 +661,17 @@ dadump(dev_t dev)
blkcnt = howmany(PAGE_SIZE, secsize);
while (num > 0) {
- void *va;
+ caddr_t va;
- if (is_physical_memory(addr)) {
- va = pmap_kenter_temporary(trunc_page(addr));
- } else {
- va = pmap_kenter_temporary(trunc_page(0));
+ if ((num / blkcnt) < dumppages)
+ dumppages = num / blkcnt;
+
+ for (i = 0; i < dumppages; ++i) {
+ vm_offset_t a = addr + (i * PAGE_SIZE);
+ if (is_physical_memory(a))
+ va = pmap_kenter_temporary(trunc_page(a), i);
+ else
+ va = pmap_kenter_temporary(trunc_page(0), i);
}
xpt_setup_ccb(&csio.ccb_h, periph->path, /*priority*/1);
@@ -677,9 +684,9 @@ dadump(dev_t dev)
/*byte2*/0,
/*minimum_cmd_size*/ softc->minimum_cmd_size,
blknum,
- blkcnt,
+ blkcnt * dumppages,
/*data_ptr*/(u_int8_t *) va,
- /*dxfer_len*/blkcnt * secsize,
+ /*dxfer_len*/blkcnt * secsize * dumppages,
/*sense_len*/SSD_FULL_SIZE,
DA_DEFAULT_TIMEOUT * 1000);
xpt_polled_action((union ccb *)&csio);
@@ -706,9 +713,9 @@ dadump(dev_t dev)
}
/* update block count */
- num -= blkcnt;
- blknum += blkcnt;
- addr += PAGE_SIZE;
+ num -= blkcnt * dumppages;
+ blknum += blkcnt * dumppages;
+ addr += PAGE_SIZE * dumppages;
/* operator aborting dump? */
if (cncheckc() != -1)
OpenPOWER on IntegriCloud