From owner-freebsd-arch@FreeBSD.ORG Tue Apr 28 15:42:50 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2DE877C; Tue, 28 Apr 2015 15:42:50 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 199FD1EBE; Tue, 28 Apr 2015 15:42:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t3SFgjlm028728 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 28 Apr 2015 18:42:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t3SFgjlm028728 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t3SFgjF8028727; Tue, 28 Apr 2015 18:42:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 Apr 2015 18:42:45 +0300 From: Konstantin Belousov To: Jason Harmening Cc: John Baldwin , freebsd-arch@freebsd.org, Svatopluk Kraus Subject: Re: bus_dmamap_sync() for bounced client buffers from user address space Message-ID: <20150428154245.GJ2390@kib.kiev.ua> References: <553B9E64.8030907@gmail.com> <20150425163444.GL2390@kib.kiev.ua> <1876382.0PQNo3Rp24@ralph.baldwin.cx> <553F9DE2.5080908@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553F9DE2.5080908@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2015 15:42:50 -0000 On Tue, Apr 28, 2015 at 09:49:06AM -0500, Jason Harmening wrote: > > Either _bus_dmamap_load_ma or out-of-context UIO_USERSPACE bounce > buffering could have issues with waiting on sfbufs on some arches, > including arm. That could be fixed by making each unmapped bounce > buffer set up a kva mapping for the data addr when it's created, but > that fix might be worse than the problem it's trying to solve. I had an implementation of the sfbuf allocator which never sleeps. If sfbuf was not available without sleep, a callback is called later, when a reusable sf buf is freed. It was written to allow drivers like PIO ATA to take unmapped bios, but I never finished it, at least did not converted a single driver. I am not sure if I can find the branch or is it reasonable to try to rebase it, but the base idea may be useful for the UIO_USERSPACE case as well.