From: Pavel Emelianov <xemul@sw.ru>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Lockdep treats down_write_trylock like regular down_write
Date: Tue, 10 Apr 2007 11:37:00 +0400 [thread overview]
Message-ID: <461B3E9C.5090606@sw.ru> (raw)
In-Reply-To: <461A5733.3080303@linux.intel.com>
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...
>
prev parent reply other threads:[~2007-04-10 7:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-09 9:56 [PATCH] Lockdep treats down_write_trylock like regular down_write Pavel Emelianov
2007-04-09 15:09 ` Arjan van de Ven
2007-04-10 7:37 ` Pavel Emelianov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=461B3E9C.5090606@sw.ru \
--to=xemul@sw.ru \
--cc=akpm@osdl.org \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox