Re: [test patch] dirty shared mappings

Eric W. Biederman (ebiederm+eric@npwt.net)
09 Jan 1998 15:30:23 -0600


>>>>> "Linus" == Linus Torvalds <torvalds@transmeta.com> writes:

Linus> Matthias Urlichs wrote:
>> Isn't an anonymous shared mapping basically the same as a SysV shared
>> memory block whose key has been deleted?

Linus> If Matthias is right, then the traditional UNIX shared memory isn't as
Linus> much of an abomination as I thought. I've obviously never used it, can
Linus> somebody set me straight (or test it out)?
Straighten.

Linus> If this is the case, then it cannot be done with just a single shared
Linus> memory backing store anyway, and it really needs the kind of support that
Linus> the current shmem code already does (so I could just make a anonymous
Linus> shared mapping turn into a shmem block internally - fairly easy).

I believe we are talking about,
mmap( start,length, prot, MAP_ANON | MAP_SHARED, -1, offset);
which is equal to:
mmap(start,length,prot, MAP_SHARED, "/dev/zero", offset);

At least that is what I would call anonymous shared memory.
It is only inherited by fork.

And if you don't want. It doesn't need the backing store, just
something to tie the VMA's together. It doesn't have a the
offset == fixed logical location problem. Because you can't map it
more than once.

Eric
ps. Does any one know about any functional changes to the swap code
in linux, since 2.0.32?
I have code that works solid on 2.0.32 but sometimes seems to be
reading random pages off the swap in 2.1.78.