From: Andrew Morton <akpm@osdl.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm lock ordering summary
Date: Fri, 25 Jun 2004 17:41:50 -0700 [thread overview]
Message-ID: <20040625174150.7ad7ee97.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0406260056300.20357-100000@localhost.localdomain>
Hugh Dickins <hugh@veritas.com> wrote:
>
> On Fri, 25 Jun 2004, Andrew Morton wrote:
> > Hugh Dickins <hugh@veritas.com> wrote:
> > >
> > > + * mm->mmap_sem
> > > + * page->flags PG_locked (lock_page)
> > > + * mapping->i_mmap_lock
> > > + * mm->page_table_lock
> > > + * swap_list_lock (in swap_free etc's swap_info_get)
> > > + * zone->lru_lock (in mark_page_accessed)
> > > + * page->flags PG_maplock (page_map_lock)
> > > + * anon_vma->lock
> > > + * swap_device_lock (in swap_duplicate, swap_info_get)
> > > + * mapping->private_lock (in __set_page_dirty_buffers)
> > > + * inode_lock (in set_page_dirty's __mark_inode_dirty)
> > > + * sb_lock (within inode_lock in fs/fs-writeback.c)
> > > + * mapping->tree_lock (widely used, in set_page_dirty,
> > > + * in arch-dependent flush_dcache_mmap_lock,
> > > + * within inode_lock in __sync_single_inode)
> >
> ...
> > the appropriate representation is
> >
> > a
> > -> b
> >
> > a
> > -> c
>
> Well, I've expressed that as
> a
> b
> c
>
Yes, but what does
a
b
c
d
mean?
The above graph tells us that one or more of (swap_device_lock,
mapping->private_lock and inode_lock) nests inside one or more of
(swap_list_lock, zone->lru_lock and page->flags PG_maplock).
And has no way of telling us _where_, say, swap_device_lock nests inside
zone->lru_lock.
And it alleges that tree_lock nests inside lru_lock, which isn't so. Is
it? These guys used to have no locking relationship. Hopefully that's
still the case. But how to represent that?
next prev parent reply other threads:[~2004-06-26 0:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-25 22:35 [PATCH] anon_vma list locking bug Hugh Dickins
2004-06-25 22:37 ` [PATCH] mm lock ordering summary Hugh Dickins
2004-06-25 23:34 ` Andrew Morton
2004-06-26 0:33 ` Hugh Dickins
2004-06-26 0:41 ` Andrew Morton [this message]
2004-06-26 1:22 ` Hugh Dickins
2004-06-26 1:39 ` Andrew Morton
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=20040625174150.7ad7ee97.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®