From owner-freebsd-arch@FreeBSD.ORG Mon Mar 2 20:42:43 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7DED864; Mon, 2 Mar 2015 20:42:43 +0000 (UTC) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F96C279; Mon, 2 Mar 2015 20:42:43 +0000 (UTC) Received: by iecrp18 with SMTP id rp18so51433623iec.1; Mon, 02 Mar 2015 12:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=yI6xxNUgyElBECOfAJQZ4NxK5e7ECW+++wODeQwcnBg=; b=PqXbZWka+owY4MXLBkDTake90Y2xhJlkzNS05Jj9V1VsrMblnJ62Z+RUc/ZN/D2sEK wA1CfQ+B9nEhU4QfOWYxb3QgIpR+t/57ZY4/NHenevrExF6tr7JfkDNWXgxcJc32NMH4 Gj+rLFIoxdAUAqwgvgHCS6QPDtlg6ZzMEErMGRQHHfsP/Vf6J5Ex0xaLp9itXUuZjsST FPcLycTgXxumgajJr2yceZU6/YRAu8OIFfK1w792v8wQ8qXpMf2mxoFz3NsQuuaqN7pR KoJqXXIja8wXGrCfuz3qCMXlW6kXYjxfwNKr1Eyj/Gd3jN9ZeVg3yk/CwrBoKb7LXSNp Kk0w== MIME-Version: 1.0 X-Received: by 10.42.130.74 with SMTP id u10mr32332176ics.61.1425328962962; Mon, 02 Mar 2015 12:42:42 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Mon, 2 Mar 2015 12:42:42 -0800 (PST) Date: Mon, 2 Mar 2015 12:42:42 -0800 X-Google-Sender-Auth: MV4jVvJ7JmxzeQyAQ3XtMFfPIXk Message-ID: Subject: Doing zero-copy stuff in drivers, or "is vm_fault_quick_hold_pages() enough" ? From: Adrian Chadd To: "freebsd-arch@freebsd.org" , freebsd-current Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 20:42:43 -0000 Hi, gonzo@ committed a fix (r278615) to the videocore driver for the raspberry pi. The fix involved doing an explicit wire of pages that were about to be passed down to the hardware to send to the videobuffer hardware. It turns out that doing vm_fault_quick_hold_pages() wasn't enough - the pages weren't being wired, and they may disappear before the hardware gets to them. I looked at vmapbuf() and how it uses vm_fault_quick_hold_pages(), but I can't find anything that wires the pages down before it hands the addresses to the hardware. So, am I missing something about how/where that's done? Thanks, -adrian