Roland Dreier <[email protected]> wrote: > > Timur> With mlock(), we don't need to use get_user_pages() at all. > Timur> Arjan tells me the only time an mlocked page can move is > Timur> with hot (un)plug of memory, but that isn't supported on > Timur> the systems that we support. We actually prefer mlock() > Timur> over get_user_pages(), because if the process dies, the > Timur> locks automatically go away too. > > There actually is another way pages can move, with both > get_user_pages() and mlock(): copy-on-write after a fork(). If > userspace does a fork(), then all PTEs are marked read-only, and if > the original process touches the page after the fork(), a new page > will be allocated and mapped at the original virtual address. Do we care about that? A straightforward scenario under which this can happen is: a) app starts some read I/O in an asynchronous manner b) app forks c) child writes to one of the pages which is still under read I/O d) the read I/O completes e) the child is left with the old data plus the child's modification instead of the new data which is a very silly application which is giving itself unpredictable memory contents anyway. I assume there's a more sensible scenario? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Roland Dreier <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- References:
- [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Roland Dreier <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Troy Benjegerdes <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Roland Dreier <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Troy Benjegerdes <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Roland Dreier <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Troy Benjegerdes <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Roland Dreier <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Andrew Morton <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Timur Tabi <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Christoph Hellwig <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Timur Tabi <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Andrew Morton <[email protected]>
- Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- From: Roland Dreier <[email protected]>
- [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- Prev by Date: Re: [PATCH 0/7] dlm: overview
- Next by Date: Re: [PATCH] PCI: Add pci shutdown ability
- Previous by thread: Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- Next by thread: Re: [PATCH][RFC][0/4] InfiniBand userspace verbs implementation
- Index(es):