Skip to contentSkip to conversation

mm: document tree_lock->zone.lock lockorder

PATCH In review Nick Piggin 2 participants 3 messages Sep 28, 2007 – Sep 29, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: document tree_lock->zone.lock lockorder

If you won't take the patch to move allocation out from under tree_lock, please apply this update to lock ordering comments.

zone->lock is quite an "inner" lock and mostly constrained to page alloc as well, so like slab locks, it probably isn't something that is critically important to document here. However unlike slab locks, zone lock could be used more widely in future, and page_alloc.c might possibly have more business to do tricky things with pagecache than does slab. So... I don't think it hurts to document it.

---

mm/filemap.c +1 -0
Index: linux-2.6/mm/filemap.c
===================================================================
@@ -63,6 +63,7 @@ generic_file_direct_IO(int rw, struct ki
  *    ->private_lock		(__free_pte->__set_page_dirty_buffers)
  *      ->swap_lock		(exclusive_swap_page, others)
  *        ->mapping->tree_lock
+ *          ->zone.lock
  *
  *  ->i_mutex
  *    ->i_mmap_lock		(truncate->unmap_mapping_range)
mm/rmap.c +1 -0
Index: linux-2.6/mm/rmap.c
===================================================================
@@ -36,6 +36,7 @@
  *                 mapping->tree_lock (widely used, in set_page_dirty,
  *                           in arch-dependent flush_dcache_mmap_lock,
  *                           within inode_lock in __sync_single_inode)
+ *                   zone->lock (within radix tree node alloc)
  */
 
 #include <linux/mm.h>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#1 lore raw
Quoted 1 line · On Fri, 28 Sep 2007 17:55:36 +0200 Nick Piggin <[email protected]> wrote:

If you won't take the patch to move allocation out from under tree_lock,

rofl@nick. My memory of patches only extends back for the previous 10000 or so. You'll need to put a tad more effort into telling us what you're referring to, sorry.

Quoted 1 line

please apply this update to lock ordering comments.

no probs, thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 8 lines · Andrew Morton
Quoted 1 line · On Fri, 28 Sep 2007 17:55:36 +0200 Nick Piggin <[email protected]> wrote:

If you won't take the patch to move allocation out from under tree_lock,

rofl@nick. My memory of patches only extends back for the previous 10000 or so. You'll need to put a tad more effort into telling us what you're referring to, sorry.

Just the patch to default the radix tree node allocation to use the preload (which will be guaranteed to be full) before falling back to doing atomic allocations under the tree_lock.

At the moment, it defaults to doing these atomic allocations first, and leaves the preload alone, even though we've just done all the work to allocate it under GFP_KERNEL.

Anyway.

Quoted 3 lines
Quoted 1 line

please apply this update to lock ordering comments.

no probs, thanks.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>