From: Kanoj Sarcar <kanojsarcar@yahoo.com>
To: Robert Love <rml@ximian.com>, Ed L Cashin <ecashin@uga.edu>
Cc: linux-mm@kvack.org
Subject: Re: Documentation/vm/locking: why not hold two PT locks?
Date: Sun, 8 Feb 2004 23:44:09 -0800 (PST) [thread overview]
Message-ID: <20040209074409.32804.qmail@web14306.mail.yahoo.com> (raw)
In-Reply-To: <1076278320.6015.1.camel@localhost>
--- Robert Love <rml@ximian.com> wrote:
> On Sun, 2004-02-08 at 16:47 -0500, Ed L Cashin
> wrote:
>
> > If that's all there is to it, then in my case, I
> have imposed a
> > locking hierarchy on my own code, so that wouldn't
> happen in my code.
> > I have a semaphore "S" outside of mmap_sem and
> page_table_lock. Every
> > call path that can get to my code takes S before
> getting the
> > mmap_sem.
>
> Well, you don't follow a locking hierarchy either,
> you just have a
> global synchronizer (your semaphore S). Same
> effect, sure, you cannot
> deadlock.
>
> But anyone else who touches two or more PT's will
> deadlock.
>
> > So it looks like my code is safe but not so
> efficient, since T2 has to
> > sleep when it doesn't get the semaphore S. Is
> there some other
> > complication I'm missing?
>
> It could be that _I_ am missing something, and there
> is another reason
> why we don't grab more than one PT concurrently.
> But the locking
> hierarchy is still a concern.
>
> Robert Love
>
Hi,
Its been a while since I wrote up those rules in
the "locking" file, but the example that Robert has
pointed out involving two different threads, each
crabbing one mm lock and trying for the next one,
is the deadlock I had in mind. There may have been
new changes in 2.5 timeframe that also requires
the rule, I am not sure.
Thanks.
Kanoj
>
> --
> To unsubscribe, send a message with 'unsubscribe
> linux-mm' in
> the body to majordomo@kvack.org. For more info on
> Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"aart@kvack.org">
> aart@kvack.org </a>
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-02-09 7:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-08 21:18 Ed L Cashin
2004-02-08 21:29 ` Robert Love
2004-02-08 21:47 ` Ed L Cashin
2004-02-08 22:12 ` Robert Love
2004-02-09 7:44 ` Kanoj Sarcar [this message]
2004-02-09 16:19 ` Ed L Cashin
2004-02-09 18:20 ` Kanoj Sarcar
2004-02-09 21:17 ` Ed L Cashin
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=20040209074409.32804.qmail@web14306.mail.yahoo.com \
--to=kanojsarcar@yahoo.com \
--cc=ecashin@uga.edu \
--cc=linux-mm@kvack.org \
--cc=rml@ximian.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