Messages in this thread | | | Date | Thu, 4 Apr 2013 11:48:01 -0700 | Subject | Re: [PATCH] mm: prevent mmap_cache race in find_vma() | From | Linus Torvalds <> |
| |
On Thu, Apr 4, 2013 at 11:35 AM, Hugh Dickins <hughd@google.com> wrote: > > find_vma() can be called by multiple threads with read lock > held on mm->mmap_sem and any of them can update mm->mmap_cache. > Prevent compiler from re-fetching mm->mmap_cache, because other > readers could update it in the meantime:
Ack. I do wonder if we should mark the unlocked update too some way (also in find_vma()), although it's probably not a problem in practice since there's no way the compiler can reasonably really do anything odd with it. We *could* make that an ACCESS_ONCE() write too just to highlight the fact that it's an unlocked write to this optimistic data structure.
Anyway, applied.
Linus
| |