Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2000 13:46:55 -0400
From:      Joy Ganguly <joy@niksun.com>
To:        Alfred Perlstein <bright@wintelcom.net>, freebsd-hackers <freebsd-hackers@freeBSD.org>
Subject:   Re: Question about file write????
Message-ID:  <3922DB0F.9D9095C9@falcon.niksun.com>
References:  <20000517160746.12768.qmail@www0a.netaddress.usa.net> <20000517102516.B14968@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein wrote:

> * Joy Ganguly <joy.ganguly@usa.net> [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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3922DB0F.9D9095C9>