Re: [PATCH] cowlinks v2

Eric W. Biederman
2004-04-05T09:15:39Z

Jörn Engel <joern@wohnheim.fh-wedel.de> writes:

> On Sat, 3 April 2004 20:43:44 +0100, Jamie Lokier wrote:
> >
> > Btw, I'm not suggesting sharing page cache entries.
>
> But I am!!!
>
> Sharing the page cache is more important to me than sharing disk
> space. Disk space is cheap, but increasing memory beyond 1GiB in my
> notebook is not and 1GiB is too little, so memory is the real
> constraint.
>
> And it looks like Pavel already found the solution. Whenever doing
> something fishy that would confuse the page cache, we
> 1. lock
> 2. invalidate page cache for all files belonging to that cow entity
> 3. copyfile(), write(), or whatever
> 4. unlock
>
> This is always possibly, because page cache for cow-files is never
> read-write. If it was, we would have done 1-4 before and now have a
> regular (non-cow) file.
>
> Did I miss something?

I know a writable mmap needs to trigger a copy in that case.
And then are fun cases with MAP_FIXED which may mean invalidation
is not allowed.

As scheme that does not isolate the invalidate to the new copy worries me.

Eric