From owner-freebsd-hackers Thu Jul 1 16:24: 7 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id D821C14D90 for ; Thu, 1 Jul 1999 16:24:05 -0700 (PDT) (envelope-from julian@whistle.com) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with SMTP id QAA95339; Thu, 1 Jul 1999 16:24:03 -0700 (PDT) Date: Thu, 1 Jul 1999 16:24:02 -0700 (PDT) From: Julian Elischer To: Zhihui Zhang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: reason for slow user-user memory copy In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hmm Unfortunatly Linux is nt relevent to FreeBSD so we can't comment directly.. it is possible that the mmapped region is marked non-cachable, which migh tmake a difference. I have no idea where "memcpy_to_iovec" in Linux is copying to so it's hard to comment. julian On Thu, 1 Jul 1999, Zhihui Zhang wrote: > > 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. > ----------------------------------------------------------------------- > > Thanks for your help. > > -------------------------------------------------- > Zhihui Zhang. Please visit http://www.freebsd.org > -------------------------------------------------- > > > > 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