From owner-freebsd-arch@FreeBSD.ORG Tue Mar 3 00:17:04 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 6421E7C8; Tue, 3 Mar 2015 00:17:04 +0000 (UTC) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (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 265D1E61; Tue, 3 Mar 2015 00:17:04 +0000 (UTC) Received: by igal13 with SMTP id l13so20554386iga.1; Mon, 02 Mar 2015 16:17:03 -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=O6ma+twoQqaH6CIF07PMVGVcafyydbyRFgPdmcxQ/ik=; b=WJNjyD8JM5yVSjifWXw04itVBGbXCOTSf20q+TcyfBwvk/qOXJTQJgYB7Qzwp90NWu +BFCy5qtOJR8+BEg5VjwptJemlrWr7NDYd6MMdS1HI63Hca+FSM0GsjyMv/Sh6ivebiO TLNVmlZLDrFGjPN44Uj3KRwz+XMalyGGfPdoiGyrid8znimeRJaukdH1HL5EaktdWsGF 7ZAg6bi+Oc0V3nekBHGoQW4ujmPIsFnyrC6iPArJpgy8kOE/b+feVi6w4NzxXPxj9F/E N6nU9ofW+ot476wR+B2n63D/yOvD3DJZYvfIjx/daE32GackFO14pXfS4tsMxvZXI45j SwRA== MIME-Version: 1.0 X-Received: by 10.50.43.201 with SMTP id y9mr25934985igl.6.1425341823612; Mon, 02 Mar 2015 16:17:03 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Mon, 2 Mar 2015 16:17:03 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Mar 2015 16:17:03 -0800 X-Google-Sender-Auth: LKAbD33Rc4Sd6D7PP2BMOdeFCGQ 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: Tue, 03 Mar 2015 00:17:04 -0000 On 2 March 2015 at 16:12, K. Macy wrote: >>> 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? > > Long enough to complete a DMA operation versus the lifetime of an > executing program. Ok, but is there a specific time length that this should be? A DMA operation to a slow device could be up to hundreds of milliseconds; or seconds if things are really backed up. Using wire instead of hold definitely made things work without having the page disappear from underneath it. Oleksander knows more about the details of that. -adrian