Re: 'cp file1 file2' takes 2x`sizeof(file)` cache (2.3.99-pre9-2)

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Wed May 17 2000 - 15:11:53 EST


Andreas Bombe wrote:
>
> On Tue, May 16, 2000 at 11:57:25PM +0200, iafilius@xs4all.nl wrote:
> > Just noticed while copying a (large/tested with 60MB) file it takes about
> > twice the file's size in cache (which takes it from free memory).
> >
> > This must be because kernel doesn't know about the same files,
> > and caches them separate.
>
> They are separate files after all, so what should it do? Do a memcmp
> over all of its caches to find whether there are identical cache
> pages?

It seems like "cp file1 file2" is very analagous to sendfile(2)
actually... :)

        Jeff

-- 
Jeff Garzik              | Liberty is always dangerous, but
Building 1024            | it is the safest thing we have.
MandrakeSoft, Inc.       |      -- Harry Emerson Fosdick

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 23 2000 - 21:00:13 EST