From owner-freebsd-arch@FreeBSD.ORG Mon Mar 2 23:49:57 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 E9BF8E6E; Mon, 2 Mar 2015 23:49:57 +0000 (UTC) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) (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 AE18BBA3; Mon, 2 Mar 2015 23:49:57 +0000 (UTC) Received: by ierx19 with SMTP id x19so52709628ier.3; Mon, 02 Mar 2015 15:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=vHsCoYnt8fm4lByVHNuUSFBJeE7qzH2FEL3+Z6dRCNU=; b=JXRanK2TPV4Yf0OkI+hm+7+zkWvXeINfOUhk+9hQNIQDgnsEoZAbTGnce0FpzFF6O8 YUdrSwVPuqyUe7v0ri0sg1v7f9Pe8j17w1eTRasKv95REoZgQqXQt6v22hhvy7oFhiaq tnYqFmXOwsKtaqbHXfWI3+eMjpB/LXtRF3HOWlNor8HLvHplzn0lJzwn7QerriECXLd+ EyA0s/FZLi5NLzl48uPFAmFLvaoKdTsmq7KVqFyF7e7++egHxfTjljzsa14oZcLc/f8S MAeNQr0wq6pnNoku0fXQQ10ThXAHBfNE4QeIJqaUWClirwyF3VUGZ9XQUIy65MhADquq imDw== MIME-Version: 1.0 X-Received: by 10.107.155.13 with SMTP id d13mr39898709ioe.29.1425340196978; Mon, 02 Mar 2015 15:49:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Mon, 2 Mar 2015 15:49:56 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Mar 2015 15:49:56 -0800 X-Google-Sender-Auth: GszTLDc9d24aTj_AC-IR8XmeAWg Message-ID: Subject: Re: Doing zero-copy stuff in drivers, or "is vm_fault_quick_hold_pages() enough" ? From: Adrian Chadd To: "K. Macy" Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current , "freebsd-arch@freebsd.org" 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 23:49:58 -0000 On 2 March 2015 at 15:05, K. Macy wrote: > On Mon, Mar 2, 2015 at 12:42 PM, Adrian Chadd wrote: >> 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. > > > Then your code is buggy or you've hit a bug in the VM. Holding a page > is a short-term wiring. Well, you can look at what's going on in the vchiq code. gonzo made it an explicit wire in order to avoid issues. > Right above vm_page_hold(): > /* > * Keep page from being freed by the page daemon > * much of the same effect as wiring, except much lower > * overhead and should be used only for *very* temporary > * holding ("wiring"). > */ What's the definition of "very temporary holding" ? What's the behavioural difference? -adrian