PERFORCE change 134388 for review

Hans Petter Selasky hselasky at FreeBSD.org
Tue Jan 29 09:38:33 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=134388

Change 134388 by hselasky at hselasky_laptop001 on 2008/01/29 17:37:37

	
	Memory reduction. BUS-DMA workaround.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#91 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#91 (text+ko) ====

@@ -2367,6 +2367,25 @@
 				goto error;
 			}
 		}
+#if 1
+		/*
+		 * XXX BUS-DMA workaround - FIXME later:
+		 *
+		 * We assume that that the aligment at this point of
+		 * the code is greater than or equal to the size and
+		 * less than two times the size, so that if we double
+		 * the size, the size will be greater than the
+		 * alignment.
+		 *
+		 * The bus-dma system has a check for "alignment"
+		 * being less than "size". If that check fails we end
+		 * up using contigmalloc which is page based even for
+		 * small allocations. Try to avoid that to save
+		 * memory, hence we sometimes to a large number of
+		 * small allocations!
+		 */
+		size *= 2;
+#endif
 	}
 	/* get the correct DMA tag */
 	utag = usbd_dma_tag_setup(parent_tag, utag, size, align, utag_max);


More information about the p4-projects mailing list