From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 1 00:18:26 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CCBF616A420 for ; Wed, 1 Feb 2006 00:18:26 +0000 (GMT) (envelope-from dipjyoti.saikia@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23CF543D45 for ; Wed, 1 Feb 2006 00:18:26 +0000 (GMT) (envelope-from dipjyoti.saikia@gmail.com) Received: by zproxy.gmail.com with SMTP id 8so29069nzo for ; Tue, 31 Jan 2006 16:18:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=t7rUTgUvhg6LlTw3TstvK8kkJ2pMmh2Y5Qc5rN/YIqNT/wVG6dJFHXScLp8H3SsbGJHmlyXn1gWFehyB/cUsnXqKTwrgof1q+G+2BkNd/0lJHJsE1oCNUM9Q+SX23zRYZ4gpGOGtCHTXNF6vz4SY0JDJxxN2tkmABCHU716/Et8= Received: by 10.36.8.15 with SMTP id 15mr6482498nzh; Tue, 31 Jan 2006 16:18:25 -0800 (PST) Received: by 10.36.77.5 with HTTP; Tue, 31 Jan 2006 16:18:25 -0800 (PST) Message-ID: Date: Wed, 1 Feb 2006 09:18:25 +0900 From: Dipjyoti Saikia To: Bharma Ji In-Reply-To: <67beabb0601301146h6c5034fao998bf573f1e89613@mail.gmail.com> MIME-Version: 1.0 References: <67beabb0601301146h6c5034fao998bf573f1e89613@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: How to pin a userland page in memory(avoid copyin and copyout) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 00:18:27 -0000 On 1/31/06, Bharma Ji wrote: > > Hi > I am trying to explore the option avoiding copyin and copyout when mode > switches from user to kernel and vice versa. One way to achieve this, as = I > understand, is to make the memory address (which contain the data to be > copied) non pageable. Then just pass the addresses to the kernel and the > data will be used directly from the userland page. Is there already some > example code / standard way to do this? > > Also is there any way one can determine the amount of time / performance > hit > (CPU %)that happening on a given process due to the copyin and copyout. I > want to understand how much performance gain one can gain if I am able to > remove copyin/copyout. > > This may give some pointers : kern/sys_pipe.c -->pipe_build_write_buffer() I was working on pipe implementation in BSD derivative of 4.10 branch and remember the same concept of pinning the user space buffer for bypassing kernel buffer. Thanks, Dip