Re: [PATCH] Fix OOPS in mmap_region() when merging adjacent VM_LOCKEDfile segments

From: Linus Torvalds
Date: Thu Jan 29 2009 - 23:53:40 EST




On Thu, 29 Jan 2009, Lee Schermerhorn wrote:
>
> Just want to note that install_special_mappings()--used for, e.g., the
> vdso--sets VM_DONTEXPAND [one of the VM_SPECIAL flags] which, if we want
> to prevent merging, makes a lot of sense to me.

Yes. VM_DONTEXPAND in many ways really fits the "don't merge" thing,
because the whole mremap() VM expansion thing is really equivalent to this
explicit merge.

> It appears that get_user_pages() will balk at addresses in vmas with
> VM_IO [and VM_PFNMAP] which might not be what one wants. For example,
> you can't pre-populate the ptes via make_pages_present() with this flag.

Well, anybody who plays games with vm_pgoff really _should_ be VM_IO. I
don't see any real reason for it except for having a very special IO
mapping. Of course, you quite possibly _also_ want VM_DONTEXPAND.

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