Re: [PATCH 1/3] revoke: misc fixes

From: Nick Piggin
Date: Mon Mar 19 2007 - 01:37:37 EST


Pekka Enberg wrote:
On 3/16/07, Nick Piggin <nickpiggin@xxxxxxxxxxxx> wrote:

Also, a down_write_trylock attempt inside i_mmap_lock should be a valid
optimisation.


I am not sure what you're thinking here. down_write_trylock acquires
->mmap_sem which can deadlock with ->i_mmap_lock, no?

You need hold and wait for a deadlock. So long as you don't block
(on mmap_sem) while holding i_mmap_lock, then you won't deadlock.

So you could just attempt a trylock, and if it works, then you
could revoke the vma right then and there. OTOH, the patch you
subsequently posted looks fine, so unless this is performance
critical then I wouldn't bother ;)

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com -
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/