Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 May 2000 10:34:52 -0400
From:      Joy Ganguly <joy@niksun.com>
To:        Matthew Dillon <dillon@apollo.backplane.com>, freebsd-hackers <freebsd-hackers@freeBSD.org>
Subject:   Re: Question about file write????
Message-ID:  <3925510C.3F6DFE5C@falcon.niksun.com>
References:  <20000517160746.12768.qmail@www0a.netaddress.usa.net> <20000517102516.B14968@fw.wintelcom.net> <3922DB0F.9D9095C9@falcon.niksun.com> <20000517135644.D14968@fw.wintelcom.net> <39231E06.31DFB153@falcon.niksun.com> <200005172324.QAA28046@apollo.backplane.com> <39241174.5CA00E48@falcon.niksun.com> <200005182239.PAA34047@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Dillon wrote:

> :I am sorry that i missed this point in my previous post. well the problem with
> :the mmap is that my device does not have a buffer always. earlier the 'read'
> :ioctl on the device used to sleep till a buffer was available. what does the
> :mmap do?? can it block?? i am sorry if this sounds naive bcoz i am a relative
> :newbie
> :
> :thanx in advance
> :
> :-joy
>
>     No, I was thinking of devices which have a fixed buffer.
>
>     Perhaps what you are looking for is something similar to sendfile().
>     Take a look at the sendfile() system call code, it might be possible
>     to adapt it for your device.
>

well i hacked the code to do the mmap. but the performance problem is still there.
the strange thing is mmap+write takes much longer than read+write. ive mmaped a
kernel buffer that was allocated with contigmalloc(). the writing the mmaped
buffer to the file takes much longer than the writing read buffer.

the ideal thing would be to do something like sendfile(). however i hvnt yet
figured out how to do it for a tranfer from a kernel buffer to a file. i think ill
have to map disk buffers to my kernel buffer. any suggestions??

thanx in advance

joy



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?3925510C.3F6DFE5C>