Messages in this thread | | | Date | Wed, 3 Sep 2003 10:55:51 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [PATCH] Alternate futex non-page-pinning and COW fix |
| |
On Wed, 3 Sep 2003, Jamie Lokier wrote: > > Hugh Dickins wrote: > > > Good question. No kernel code seems to check VM_MAYSHARE - the one to > > > check is VM_SHARED. > > > > Observe fs/procfs/task_mmu.c show_map checking VM_MAYSHARE for 's'. > > Observe mm/mmap.c do_mmap_pgoff vm_flags &= ~(VM_MAYWRITE | VM_SHARED). > > VM_MAYSHARE reflects whether user chose MAP_SHARED, VM_SHARED may not. > > Hugh, thank you. In the case of futex.c, either flag could be used to > mean "is this a shared" mapping, and each choice has a different > user-visible meaning.
Actually: the VM_SHARED flag will never change, so testing VM_SHARED is actually the _right_ thing from a mm perspective.
The only person who should ever test VM_MAYSHARE is somebody who does reporting back to user space: VM_MAYSHARE basically ends up meaning "the user _asked_ for a shared mapping". While "VM_SHARED" means "this mapping can actually contain a shared dirty page".
The VM itself should only ever care about VM_SHARED. Because that's the only bit that has real semantic meaning.
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |