[parisc-linux-cvs] DIFF 2.6.1-pa10 tweak SBA/LBA

Grant Grundler grundler at parisc-linux.org
Thu Jan 22 19:07:25 MST 2004


On Thu, Jan 22, 2004 at 06:42:05PM -0700, Grant Grundler wrote:
> Log message:
> 2.6.1-pa10 tweaks to SBA/LBA
> o SBA: remove stats gathering - no one looks at it and it costs performance
> o SBA: fix sg_virt_addr() ref in debug code (Joel Soete)
> o LBA: undef DEBUG_PAT and change constant to ~0U.


Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.6/Makefile,v
retrieving revision 1.115
diff -u -p -r1.115 Makefile
--- Makefile	23 Jan 2004 00:04:43 -0000	1.115
+++ Makefile	23 Jan 2004 01:40:23 -0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 1
-EXTRAVERSION = -pa9
+EXTRAVERSION = -pa10
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
Index: drivers/parisc/sba_iommu.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/parisc/sba_iommu.c,v
retrieving revision 1.6
diff -u -p -r1.6 sba_iommu.c
--- drivers/parisc/sba_iommu.c	20 Jan 2004 01:49:18 -0000	1.6
+++ drivers/parisc/sba_iommu.c	23 Jan 2004 01:40:23 -0000
@@ -44,6 +44,11 @@
 
 #define MODULE_NAME "SBA"
 
+#ifdef CONFIG_PROC_FS
+/* depends on proc fs support. But costs CPU performance */
+#undef SBA_COLLECT_STATS
+#endif
+
 /*
 ** The number of debug flags is a clue - this code is fragile.
 ** Don't even think about messing with it unless you have
@@ -217,7 +222,7 @@ struct ioc {
 	} saved[DELAYED_RESOURCE_CNT];
 #endif
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 #define SBA_SEARCH_SAMPLE	0x100
 	unsigned long avg_search[SBA_SEARCH_SAMPLE];
 	unsigned long avg_idx;	/* current index into avg_search */
@@ -560,7 +565,7 @@ static int
 sba_alloc_range(struct ioc *ioc, size_t size)
 {
 	unsigned int pages_needed = size >> IOVP_SHIFT;
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	unsigned long cr_start = mfctl(16);
 #endif
 	unsigned long pide;
@@ -595,7 +600,7 @@ sba_alloc_range(struct ioc *ioc, size_t 
 		(uint) ((unsigned long) ioc->res_hint - (unsigned long) ioc->res_map),
 		ioc->res_bitshift );
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	{
 		unsigned long cr_end = mfctl(16);
 		unsigned long tmp = cr_end - cr_start;
@@ -637,7 +642,7 @@ sba_free_range(struct ioc *ioc, dma_addr
 		__FUNCTION__, (uint) iova, size,
 		bits_not_wanted, m, pide, res_ptr, *res_ptr);
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	ioc->used_pages -= bits_not_wanted;
 #endif
 
@@ -855,7 +860,7 @@ sba_map_single(struct device *dev, void 
 	sba_check_pdir(ioc,"Check before sba_map_single()");
 #endif
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	ioc->msingle_calls++;
 	ioc->msingle_pages += size >> IOVP_SHIFT;
 #endif
@@ -930,7 +935,7 @@ sba_unmap_single(struct device *dev, dma
 
 	spin_lock_irqsave(&ioc->res_lock, flags);
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	ioc->usingle_calls++;
 	ioc->usingle_pages += size >> IOVP_SHIFT;
 #endif
@@ -1058,7 +1063,7 @@ sba_fill_pdir(
 			printk(KERN_DEBUG " %2d : %08lx/%05x %p/%05x\n",
 				nents,
 				(unsigned long) sg_dma_address(startsg), cnt,
-				sg_virt_address(startsg), startsg->length
+				sg_virt_addr(startsg), startsg->length
 		);
 #else
 		DBG_RUN_SG(" %d : %08lx/%05x %p/%05x\n",
@@ -1094,7 +1099,7 @@ sba_fill_pdir(
 			cnt += dma_offset;
 			dma_offset=0;	/* only want offset on first chunk */
 			cnt = ROUNDUP(cnt, IOVP_SIZE);
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 			ioc->msg_pages += cnt >> IOVP_SHIFT;
 #endif
 			do {
@@ -1301,7 +1306,7 @@ sba_map_sg(struct device *dev, struct sc
 	}
 #endif
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	ioc->msg_calls++;
 #endif
 
@@ -1366,7 +1371,7 @@ sba_unmap_sg(struct device *dev, struct 
 	ioc = GET_IOC(dev);
 	ASSERT(ioc);
 
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 	ioc->usg_calls++;
 #endif
 
@@ -1379,7 +1384,7 @@ sba_unmap_sg(struct device *dev, struct 
 	while (sg_dma_len(sglist) && nents--) {
 
 		sba_unmap_single(dev, sg_dma_address(sglist), sg_dma_len(sglist), direction);
-#ifdef CONFIG_PROC_FS
+#ifdef SBA_COLLECT_STATS
 		ioc->usg_pages += ((sg_dma_address(sglist) & ~IOVP_MASK) + sg_dma_len(sglist) + IOVP_SIZE - 1) >> PAGE_SHIFT;
 		ioc->usingle_calls--;	/* kluge since call is unmap_sg() */
 #endif
@@ -1846,7 +1851,9 @@ static int sba_proc_info(char *buf, char
 	struct sba_device *sba_dev = sba_list;
 	struct ioc *ioc = &sba_dev->ioc[0];	/* FIXME: Multi-IOC support! */
 	int total_pages = (int) (ioc->res_size << 3); /* 8 bits per byte */
+#ifdef SBA_COLLECT_STATS
 	unsigned long i = 0, avg = 0, min, max;
+#endif
 
 	sprintf(buf, "%s rev %d.%d\n",
 		sba_dev->name,
@@ -1858,12 +1865,13 @@ static int sba_proc_info(char *buf, char
 		(int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */
 		total_pages);
 
+	sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", 
+		buf, ioc->res_size, ioc->res_size << 3);   /* 8 bits per byte */
+
+#ifdef SBA_COLLECT_STATS
 	sprintf(buf, "%sIO PDIR entries : %ld free  %ld used (%d%%)\n", buf,
 		total_pages - ioc->used_pages, ioc->used_pages,
 		(int) (ioc->used_pages * 100 / total_pages));
-	
-	sprintf(buf, "%sResource bitmap : %d bytes (%d pages)\n", 
-		buf, ioc->res_size, ioc->res_size << 3);   /* 8 bits per byte */
 
 	min = max = ioc->avg_search[0];
 	for (i = 0; i < SBA_SEARCH_SAMPLE; i++) {
@@ -1893,6 +1901,7 @@ static int sba_proc_info(char *buf, char
 	sprintf(buf, "%spci_unmap_sg()  : %12ld calls  %12ld pages (avg %d/1000)\n",
 		buf, ioc->usg_calls, ioc->usg_pages,
 		(int) ((ioc->usg_pages * 1000)/ioc->usg_calls));
+#endif
 
 	return strlen(buf);
 }
Index: drivers/parisc/lba_pci.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/parisc/lba_pci.c,v
retrieving revision 1.6
diff -u -p -r1.6 lba_pci.c
--- drivers/parisc/lba_pci.c	17 Jan 2004 06:39:25 -0000	1.6
+++ drivers/parisc/lba_pci.c	23 Jan 2004 01:40:23 -0000
@@ -60,7 +60,7 @@
 #undef DEBUG_LBA	/* general stuff */
 #undef DEBUG_LBA_PORT	/* debug I/O Port access */
 #undef DEBUG_LBA_CFG	/* debug Config Space Access (ie PCI Bus walk) */
-#define DEBUG_LBA_PAT	/* debug PCI Resource Mgt code - PDC PAT only */
+#undef DEBUG_LBA_PAT	/* debug PCI Resource Mgt code - PDC PAT only */
 
 #undef FBB_SUPPORT	/* Fast Back-Back xfers - NOT READY YET */
 
@@ -518,7 +518,7 @@ static int lba_cfg_read(struct pci_bus *
 		  with risk we will miss PCI bus errors. */
 		*data = lba_rd_cfg(d, tok, pos, size);
 		DBG_CFG("%s(%x+%2x) -> 0x%x (a)\n", __FUNCTION__, tok, pos, *data);
-		return(*data == ~0UL);
+		return(*data == ~0U);
 	}
 
 	if (LBA_SKIP_PROBE(d) && (!lba_device_present(bus->secondary, devfn, d)))


More information about the parisc-linux-cvs mailing list