From owner-freebsd-hackers Wed May 17 10:46:50 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from arjun.niksun.com (gwnew.niksun.com [206.20.52.130]) by hub.freebsd.org (Postfix) with ESMTP id 6D38C37B587 for ; Wed, 17 May 2000 10:46:46 -0700 (PDT) (envelope-from joy@niksun.com) Received: from falcon.niksun.com (falcon.niksun.com [10.0.0.167]) by arjun.niksun.com (8.9.3/8.9.3) with ESMTP id NAA99083; Wed, 17 May 2000 13:46:42 -0400 (EDT) (envelope-from joy@falcon.niksun.com) Message-ID: <3922DB0F.9D9095C9@falcon.niksun.com> Date: Wed, 17 May 2000 13:46:55 -0400 From: Joy Ganguly X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Alfred Perlstein , freebsd-hackers Subject: Re: Question about file write???? References: <20000517160746.12768.qmail@www0a.netaddress.usa.net> <20000517102516.B14968@fw.wintelcom.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred Perlstein wrote: > * Joy Ganguly [000517 09:41] wrote: > > > > hi all, > > > > i have written a special ioctl which writes data into a file from a buffer in > > kernel memory. it invokes fo->fo_write() and involves one copy from kernel > > mem > > to disk cache. however this takes substantially more time than an ordinary > > write which copies from user space to the disk cache. any explanations??? > > What are you using for your kernel to kernel copy? > fo->fo_write uses uiomove() with seg_flg = UIO_SYSSPACE. uiomove() uses bcopy() to do the actual copying. my ioctl sets up the struct uio to point to the kernel buf and calls fo->fo_write(). Hence the only difference between my ioctl and original write is that the former has seg_flg = UIO_SYSSPACE and the latter has UIO_USERSPACE. > > (copyin and friends are hand optimized for great speed when copying > from/to userspace) > what sort of optimizations are you referrring to?? is there some other way i can do this?? > > -- > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > "I have the heart of a child; I keep it in a jar on my desk." > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message