From owner-freebsd-arch@FreeBSD.ORG Tue Mar 3 00:37:14 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 F2894103; Tue, 3 Mar 2015 00:37:13 +0000 (UTC) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (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 B2C63E1; Tue, 3 Mar 2015 00:37:13 +0000 (UTC) Received: by igbhn18 with SMTP id hn18so22318172igb.2; Mon, 02 Mar 2015 16:37:13 -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=/ywBmXikn/5JrH1PePyqOs1uXBgi5ufbpnJ1XlzX2A4=; b=G2JdhU4ZYJ94WCukjJldctNbC4WunxmZvy3gKRSoN4YTrEbYdWvT+eccXHhICYZAYH swdtjcEF1AIzaWz7vqcjivMmYK1uE9g7KMp1585Iaw+QswDOgTGy95FppsYJm4KWdqxz 38Os+5EtX/X5FuFzgtzPc3F4RIsNBj2nXLjJ0XdO+fWCI8VVF7yVX6o4C8F6i7guuNP+ ebQp9qZacjGu5ReH0g86bATcCRisJpbtHad4ifsVpRy0VOkxH7bvzzrL0PMfdFUEoLx2 FArys+znk6lhkbcCIP03jTAXut8jSb0g/WwWXEtAzvwQMO6lNHahhK7knIZvQ2r1eSky vq4w== MIME-Version: 1.0 X-Received: by 10.42.188.133 with SMTP id da5mr34081038icb.37.1425343033199; Mon, 02 Mar 2015 16:37:13 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.66 with HTTP; Mon, 2 Mar 2015 16:37:13 -0800 (PST) In-Reply-To: <20150303002536.GE2379@kib.kiev.ua> References: <20150303002536.GE2379@kib.kiev.ua> Date: Mon, 2 Mar 2015 16:37:13 -0800 X-Google-Sender-Auth: 3Um-zdb7MZ5WGA0o8Yr7A8iCP74 Message-ID: Subject: Re: Doing zero-copy stuff in drivers, or "is vm_fault_quick_hold_pages() enough" ? From: Adrian Chadd To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: freebsd-current , "K. Macy" , "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:37:14 -0000 On 2 March 2015 at 16:25, Konstantin Belousov wrote: >> Ok, but is there a specific time length that this should be? > Difference between hold and wire is effectively that held pages are > still kept on the page queues, providing potentially uneccessary work > for pagedaemon to find them and skip. Wired pages are removed from the > queues. > > This means that holding a page is much cheaper, by the cost of leaving > slightly more work to the system. Also, holding a page only requires the > page lock, while wiring contend on the page queue lock, in addition to > the page lock. Thanks for the description - that makes things a lot clearer! >> >> 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. > > Page cannot 'disappear'. The only thing which could happen with the > memory page is reuse, when the page is removed from the previous object > and re-purposed for some other object, loosing old content. > > Your terminology suggests that something unrelated happen. Yup, and that's what I'm worried about :( -adrian