Re: [PATCH 08 of 11] anon-vma-rwsem

From: Linus Torvalds
Date: Wed May 07 2008 - 20:10:49 EST




On Wed, 7 May 2008, Christoph Lameter wrote:
>
> Multiple vmas may share the same mapping or refer to the same anonymous
> vma. The above code will deadlock since we may take some locks multiple
> times.

Ok, so that actually _is_ a problem. It would be easy enough to also add
just a flag to the vma (VM_MULTILOCKED), which is still cleaner than doing
a vmalloc and a whole sort thing, but if this is really rare, maybe Ben's
suggestion of just using stop-machine is actually the right one just
because it's _so_ simple.

(That said, we're not running out of vm flags yet, and if we were, we
could just add another word. We're already wasting that space right now on
64-bit by calling it "unsigned long").

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/