Date: Tue, 29 Jan 2008 17:38:32 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 134388 for review Message-ID: <200801291738.m0THcWIX093374@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134388 Change 134388 by hselasky@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801291738.m0THcWIX093374>