On Tuesday 17 November 2009 06:43, Shane wrote:
>On Tue, 2009-11-17 at 00:36 +0000, Bishop, Peter wrote:
>> Thanks again Shane, were you testing with tapes?  I'm going to see
>> what I can do to set up a test against our tape library and get some
>> real results to work with.
>
>Nope - I was just tooling around with some disk tests.
>
>Then Edmund added:
>> It's not quite that smart.  Linux has to copy the data from
>> kernel-space buffers into user-space memory, at least.
>> So even if the block of data is in the page cache, there's
>> still a copy operation.
>
>And Ivan:
>> I believe that linux has a mechanism that allows movement of data
>> between files and pipes and between pipes and files so that no data is
>> actually ever copied to user space.
>>
>> See: splice(2)
>
>The odd-ball numbers I mentioned I saw were from tests run on data
>residing completely in the page cache (a Gig of data in my case).
>First run was a simple cat to /dev/null.
>Second was a cat to the named pipe, and a cat (to /dev/null) on the
>other side.
>Took *more than* twice as long (elapsed).
>Hmmm - hadn't expected that.
>
>So I ran systemtap over all the mm (memory management) calls - nothing
>out of the ordinary there. Likewise for the userspace calls - twice as
>many reads and writes. So what.
>Decide to trace copy_to_user and copy_from_user based on Edmunds post.
>On the run I keep numbers from,
>copy_from_user: jumped from 4428 to 20192 between the two runs.
>copy_to_user: jumped from 3688 to 47883 between the two runs.
>
>Might explain that jump in "sys" time I guess.

Well, yeah!  Nice work there, Shane; you're digging a lot deeper than I was 
willing to go.  So copies from user-space went up by a factor of 4.5, and 
copies to user-space jumped by almost 13 times?  I have no idea why that 
would be.  I would expect both ratios to be the same.

>Ivans post came in just as I was about to leave - I did a quick test,
>but was unable to find any evidence of splice usage. However this was a
>2.6.18 kernel and splice was only merged in 2.6.17.

Hadn't heard of splice(2) before, because it is very new.  It's not in the 
SLES 10 kernels (2.6.16).  Even if it were in your kernel, it's unlikely 
anyone's applications use it.  Neither does cat(1), as of yet 
(coreutils-7.6).  That's a pity, because this call could really increase the 
throughput of processes that just copy data around.
        - MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software
275 Grove Street · Newton, MA 02466-2272 · USA
Tel: +1.617.614.4321
Email: m...@rs.com
Web: www.rocketsoftware.com  

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to