linux-IllusionX/mm
Nick Piggin 7cf9c2c76c [PATCH] radix-tree: RCU lockless readside
Make radix tree lookups safe to be performed without locks.  Readers are
protected against nodes being deleted by using RCU based freeing.  Readers
are protected against new node insertion by using memory barriers to ensure
the node itself will be properly written before it is visible in the radix
tree.

Each radix tree node keeps a record of their height (above leaf nodes).
This height does not change after insertion -- when the radix tree is
extended, higher nodes are only inserted in the top.  So a lookup can take
the pointer to what is *now* the root node, and traverse down it even if
the tree is concurrently extended and this node becomes a subtree of a new
root.

"Direct" pointers (tree height of 0, where root->rnode points directly to
the data item) are handled by using the low bit of the pointer to signal
whether rnode is a direct pointer or a pointer to a radix tree node.

When a reader wants to traverse the next branch, they will take a copy of
the pointer.  This pointer will be either NULL (and the branch is empty) or
non-NULL (and will point to a valid node).

[akpm@osdl.org: cleanups]
[Lee.Schermerhorn@hp.com: bugfixes, comments, simplifications]
[clameter@sgi.com: build fix]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:25 -08:00
..
allocpercpu.c
backing-dev.c
bootmem.c
bounce.c
fadvise.c
filemap.c
filemap.h
filemap_xip.c
fremap.c [PATCH] kill install_file_pte's pte_val 2006-12-07 08:39:23 -08:00
highmem.c
hugetlb.c [PATCH] mm: make compound page destructor handling explicit 2006-12-07 08:39:25 -08:00
internal.h
Kconfig
madvise.c
Makefile
memory.c
memory_hotplug.c
mempolicy.c [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
mempool.c
migrate.c [PATCH] radix-tree: RCU lockless readside 2006-12-07 08:39:25 -08:00
mincore.c
mlock.c
mmap.c [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
mmzone.c
mprotect.c
mremap.c
msync.c
nommu.c
oom_kill.c
page-writeback.c
page_alloc.c [PATCH] mm: make compound page destructor handling explicit 2006-12-07 08:39:25 -08:00
page_io.c
pdflush.c
prio_tree.c
readahead.c
rmap.c
shmem.c [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
shmem_acl.c
slab.c [PATCH] slab: better fallback allocation behavior 2006-12-07 08:39:25 -08:00
slob.c
sparse.c
swap.c [PATCH] mm: make compound page destructor handling explicit 2006-12-07 08:39:25 -08:00
swap_state.c
swapfile.c [PATCH] reject corrupt swapfiles earlier 2006-12-07 08:39:23 -08:00
thrash.c
tiny-shmem.c
truncate.c
util.c
vmalloc.c
vmscan.c
vmstat.c [PATCH] mm: cleanup indentation on switch for CPU operations 2006-12-07 08:39:23 -08:00