From owner-svn-src-all@FreeBSD.ORG Fri May 30 14:54:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2B95897; Fri, 30 May 2014 14:54:10 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAA3A2E2B; Fri, 30 May 2014 14:54:09 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id f8so1252628wiw.8 for ; Fri, 30 May 2014 07:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=4LqLNe5JwbGNtV9c6f3sFkoYctCi+Hu+/REQ18s7X7E=; b=jrhaPiGd5mc67y5KQiHKHjuqc01befgyxXFHfvmtdHyw7rlOvIAuCoh976kaQN/B65 R3Xiqfw848+qBotudtOrm23/ECg5jrFprhKUBQSeUluKcl7d2Hh9EYvN/5kmm4x7vLOe +UiSqIOBQU8fxFh18Arr40PJg0igcLaVOpfIiAemPPEDSd2/fOfACvR8E8Ndn/MGnB0A dA6ydIXUZpyIsAFVmcUf/3dT+qOnRsSmD3sworAE8a+1IdXhXZGaaQt0jWJNWv5moa2j XtXB6LYaqeds6oRAsFJn0mMxa+TY8BXt3qwttbCPEOos6SLcSB/ny/GBCHihmrnkxitk 3gKw== MIME-Version: 1.0 X-Received: by 10.194.7.232 with SMTP id m8mr22880308wja.47.1401461646588; Fri, 30 May 2014 07:54:06 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Fri, 30 May 2014 07:54:06 -0700 (PDT) In-Reply-To: <201405272131.s4RLVBEU035321@svn.freebsd.org> References: <201405272131.s4RLVBEU035321@svn.freebsd.org> Date: Fri, 30 May 2014 16:54:06 +0200 X-Google-Sender-Auth: KFtBUtGqOOMcassDU0T1iXNNeKs Message-ID: Subject: Re: svn commit: r266775 - head/sys/x86/x86 From: Attilio Rao To: Scott Long Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Peel, Casey" , Benno Rice X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:54:10 -0000 On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: > Author: scottl > Date: Tue May 27 21:31:11 2014 > New Revision: 266775 > URL: http://svnweb.freebsd.org/changeset/base/266775 > > Log: > Eliminate the fake contig_dmamap and replace it with a new flag, > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag > means that the map can be NULL again, which in turn enables significant > optimizations for the common case of no bouncing. While I think this is in general a good idea, unfortunately our drivers do so many dumb things when freeing DMA allocated buffers that having a NULL map is going to cause some "turbolence" and make such bugs more visible. An example is with ATA, where I think this fix is needed: http://www.freebsd.org/~attilio/dmamem_free-ata.patch Otherwise, what can happen with bounce buffers, is that the allocated memory via contig malloc was not going to be freed anytime. I tried to look around and I found questionable (read broken) code in basically every driver which allocates DMA buffers, so I really don't feel I want to fix the majority of our drivers. I just think such paths are not excercised enough to be seen in practice often or the bugs just get unnoticed. Attilio -- Peace can only be achieved by understanding - A. Einstein