[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <461B3E9C.5090606@sw.ru>
Date: Tue, 10 Apr 2007 11:37:00 +0400
From: Pavel Emelianov <xemul@...ru>
To: Arjan van de Ven <arjan@...ux.intel.com>
CC: Andrew Morton <akpm@...l.org>, Ingo Molnar <mingo@...hat.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Lockdep treats down_write_trylock like regular down_write
Arjan van de Ven wrote:
> Pavel Emelianov wrote:
>> This causes constructions like
>>
>> down_write(&mm1->mmap_sem);
>> if (down_write_trylock(&mm2->mmap_sem)) {
>> ...
>> up_write(&mm2->mmap_sem);
>> }
>> up_write(&mm1->mmap_sem);
>>
>> generate a lockdep warning about circular locking dependence.
>
> please show me why this is safe, especially if you intermix it with
> down_read()'s... like copy_to_user and co may do.
This is safe as once the task locks the mm1->mmap_sem and gets
into '...' place it is *running* and will release booth semaphores
for sure.
> this feels like a very unsafe construct to me...
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists