Date: Thu, 01 Jul 1999 16:37:11 -0700 From: David Greenman <dg@root.com> To: Zhihui Zhang <zzhang@cs.binghamton.edu> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: reason for slow user-user memory copy Message-ID: <199907012337.QAA07652@implode.root.com> In-Reply-To: Your message of "Thu, 01 Jul 1999 19:06:54 EDT." <Pine.GSO.3.96.990701185753.3735A-100000@sol.cs.binghamton.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
>A graduate student here implements a mmap() interface to a TCP/IP network >card. He notices that it takes much longer time to copy from mmapp()'ed >area to another user area than it takes to copy the same amount of data >from kernel space to user space. The students here have no idea why this >could be possible. I hope someone on this list can give us a hint. Below >is a part of his original email. He uses rdtsc instruction to do the >timing. > >------------------------------------------------------------------------ >Well I have implemented a memory mapped interface for the user in Linux >using the DEC 21140 Tulip ethernet card. Thus the user has access to the >buffers, but when I did a memcpy from the RX buffer to the user variable, >it took an extraordinary amount of time, approx 70 microsec for 1460 >btyes... where as the original scheme takes 25 microsec for the same data >when it does a memcpy_to_iovec in tcp_recvmsg(). > >I am confused by this unexpected timings. More than 80% of the time is >spent doing the memcpy. >----------------------------------------------------------------------- If the mapping is being done via a device mapping, then the region will be marked non-cacheable. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org Creator of high-performance Internet servers - http://www.terasolutions.com 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?199907012337.QAA07652>