Re: [patch] 'virtual => physical page mapping cache', vcache-2.5.38-B8

Linus Torvalds (torvalds@transmeta.com)
Fri, 27 Sep 2002 09:26:36 -0700 (PDT)


On Fri, 27 Sep 2002, Ingo Molnar wrote:
>
> the attached patch implements the virtual => physical cache. Right now
> only the COW code calls the invalidation function, because futexes do not
> need notification on unmap.

Ok, looks good. Except you make get_user_page() do a write fault on the
page, and one of the points of this approach was that that shouldn't even
be needed. Or did I miss some case that does need it?

> I have fixed a new futex bug as well: pin_page() alone does not guarantee
> that the mapping does not change magically, only taking the MM semaphore
> in write-mode does.

And this makes no sense to me.

A read lock on the semaphore should give you all the same protection as a
write lock does.

To protect against the swapper etc, you really need to get the mm
spinlock, not the semaphore. And once you have the spinlock, you should be
totally safe. Please explain what you saw?

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/