mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 16:34:00 -0700	[thread overview]
Message-ID: <20040625163400.43552a08.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0406252335410.19814-100000@localhost.localdomain>

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)

What happened to "i_sem nests inside mmap_sem"?

This representation tends to lose information - it implies that all the
above locks are taken at the same time and it makes it harder to capture
information about where in the kernel the particular ranking occurs.

I mean, if some code does:

	down(a);
	down(b);

and some other code does

	down(a);
	down(c);

the appropriate representation is

	a
	-> b

	a
	-> c



  reply	other threads:[~2004-06-25 23:32 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 [this message]
2004-06-26  0:33     ` Hugh Dickins
2004-06-26  0:41       ` Andrew Morton
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=20040625163400.43552a08.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®