From owner-freebsd-current@FreeBSD.ORG Mon Mar 2 23:06:00 2015 Return-Path: Delivered-To: freebsd-current@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 61522CFB; Mon, 2 Mar 2015 23:06:00 +0000 (UTC) Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com [IPv6:2607:f8b0:4002:c01::230]) (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 1C0436DA; Mon, 2 Mar 2015 23:06:00 +0000 (UTC) Received: by yhoa41 with SMTP id a41so16372674yho.9; Mon, 02 Mar 2015 15:05:59 -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=I2W/TD3ky1JofeJdLHe2L3621FCeCd8zVSnl7JqeqQ0=; b=A7VF9zwIdYK2zI+9Pszrfr0F/3fxfVNuOsl5u+7byaDagcFyiFe3rJjvFJXBWn7Pbt vQZ+DheDyf5gX7Fu+jvU6AvTk4a6XUuX2yPg2sszuOKZs4tekRsutZ/JXVQEW/z8+p5y tO4sch7uy2CBtlZZSsxVgpOw0PYsdwTZ9YymnGyWp6RouKyq1OJJPBvhoweF1Xw/7tl2 S/2D6hW+tMNT9awJgUGGt2+wDAfPvF75OiP/8VZcmtgHtVCrSOEyClzd4yiSKNW/mFS3 4UmNn9zf3IenJtcttxTGjZY+4Cg3jxBVnNurVNAn0EW9pGnufZroVjn632H8efeduI1o V8Yw== MIME-Version: 1.0 X-Received: by 10.170.185.71 with SMTP id b68mr13529604yke.25.1425337559164; Mon, 02 Mar 2015 15:05:59 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.170.76.66 with HTTP; Mon, 2 Mar 2015 15:05:59 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Mar 2015 15:05:59 -0800 X-Google-Sender-Auth: 1k4rEY3CGKDdAhTV-jSklRrpPyY Message-ID: Subject: Re: Doing zero-copy stuff in drivers, or "is vm_fault_quick_hold_pages() enough" ? From: "K. Macy" To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 23:06:00 -0000 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. 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"). */ > 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? Yes. > Thanks, > > > -adrian > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"