On 1/31/06, Bharma Ji <[EMAIL PROTECTED]> 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?
The only way Im aware is to mmap() a file. The vtophys() translation will be different for kernel and userspace -but there will be no copyin()/copyout() involved. 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. It has an overhead both in copying data as well as using 2x the amt of memory required. If you just need to pass parameters, copyin()/out() works fine. If you want to read a multimedia device or pass some other huge block of memory across address spaces, then mmap() helps. FYI -there is an mmap() method supported by usb driver frameworks. regards -kamal _______________________________________________ > [email protected] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "[EMAIL PROTECTED]" > _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

