[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linux wppage patch (fwd)



>>>>> "JC" == Rik van Riel <H.H.vanRiel@phys.uu.nl> writes:

JC> ---------- Forwarded message ----------
JC> Date: Thu, 25 Jun 1998 21:10:00 -0700 (PDT)
JC> From: Jason Crawford <jasonc@cacr.caltech.edu>
JC> To: h.h.vanriel@phys.uu.nl
JC> Subject: Linux wppage patch

JC> 2. Make a slight change to the way the custom nopage routine is called.
JC> The third argument to nopage is declared as "write_access" in the
JC> definition of the VM operations struct in mm.h. But when it's called, it
JC> is actually "no_share", computed as:

JC> 	(vma->vm_flags & VM_SHARED) ? 0 : write_access

JC> My code, however, needs to know whether the access was a write even
JC> though it is shared memory, so I would like to change this argument to
JC> just "write_access". Since the VMA is passed in to the routine anyway,
JC> the VM flags will be available, and any routine which wants to calculate
JC> "no_share" can do so. Again, I searched the Linux source tree, and only
JC> the generic filemap_nopage routine uses the no_share argument. It can
JC> easily be changed to accept "write_access" instead of "no_share" and
JC> calculate "no_share" before it does any work.

Your code basically looks reasonable but there is a potential gotcha
in the works.

Shared pages are never write protected by the nopage routine so you
will never discover if a shared page has been written too...

Which could cause all kinds of havoc for distrubuted shared memory.

Eric