From owner-p4-projects@FreeBSD.ORG Tue Jan 29 17:38:33 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6E5B316A46B; Tue, 29 Jan 2008 17:38:33 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3307F16A421 for ; Tue, 29 Jan 2008 17:38:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2409713C4E7 for ; Tue, 29 Jan 2008 17:38:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0THcXae093377 for ; Tue, 29 Jan 2008 17:38:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0THcWIX093374 for perforce@freebsd.org; Tue, 29 Jan 2008 17:38:32 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 29 Jan 2008 17:38:32 GMT Message-Id: <200801291738.m0THcWIX093374@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 134388 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2008 17:38:33 -0000 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);