Revision 6328650bb4d854a7dc1498d1c0048b838b0d340c authored by Hugh Dickins on 03 August 2011, 23:21:18 UTC, committed by Linus Torvalds on 04 August 2011, 00:25:22 UTC
A patchset to extend tmpfs to MAX_LFS_FILESIZE by abandoning its
peculiar swap vector, instead keeping a file's swap entries in the same
radix tree as its struct page pointers: thus saving memory, and
simplifying its code and locking.

This patch:

The radix_tree is used by several subsystems for different purposes.  A
major use is to store the struct page pointers of a file's pagecache for
memory management.  But what if mm wanted to store something other than
page pointers there too?

The low bit of a radix_tree entry is already used to denote an indirect
pointer, for internal use, and the unlikely radix_tree_deref_retry()
case.

Define the next bit as denoting an exceptional entry, and supply inline
functions radix_tree_exception() to return non-0 in either unlikely
case, and radix_tree_exceptional_entry() to return non-0 in the second
case.

If a subsystem already uses radix_tree with that bit set, no problem: it
does not affect internal workings at all, but is defined for the
convenience of those storing well-aligned pointers in the radix_tree.

The radix_tree_gang_lookups have an implicit assumption that the caller
can deduce the offset of each entry returned e.g.  by the page->index of
a struct page.  But that may not be feasible for some kinds of item to
be stored there.

radix_tree_gang_lookup_slot() allow for an optional indices argument,
output array in which to return those offsets.  The same could be added
to other radix_tree_gang_lookups, but for now keep it to the only one
for which we need it.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 70d3271
History
File Mode Size
Kconfig -rw-r--r-- 12.3 KB
Kconfig.debug -rw-r--r-- 908 bytes
Makefile -rw-r--r-- 1.8 KB
backing-dev.c -rw-r--r-- 21.4 KB
bootmem.c -rw-r--r-- 20.8 KB
bounce.c -rw-r--r-- 6.5 KB
cleancache.c -rw-r--r-- 6.9 KB
compaction.c -rw-r--r-- 20.0 KB
debug-pagealloc.c -rw-r--r-- 2.5 KB
dmapool.c -rw-r--r-- 13.0 KB
fadvise.c -rw-r--r-- 3.5 KB
failslab.c -rw-r--r-- 1.3 KB
filemap.c -rw-r--r-- 69.4 KB
filemap_xip.c -rw-r--r-- 11.0 KB
fremap.c -rw-r--r-- 6.7 KB
highmem.c -rw-r--r-- 10.3 KB
huge_memory.c -rw-r--r-- 61.5 KB
hugetlb.c -rw-r--r-- 76.3 KB
hwpoison-inject.c -rw-r--r-- 3.3 KB
init-mm.c -rw-r--r-- 619 bytes
internal.h -rw-r--r-- 7.2 KB
kmemcheck.c -rw-r--r-- 2.8 KB
kmemleak-test.c -rw-r--r-- 3.3 KB
kmemleak.c -rw-r--r-- 49.7 KB
ksm.c -rw-r--r-- 54.7 KB
maccess.c -rw-r--r-- 1.6 KB
madvise.c -rw-r--r-- 11.5 KB
memblock.c -rw-r--r-- 22.6 KB
memcontrol.c -rw-r--r-- 146.7 KB
memory-failure.c -rw-r--r-- 39.1 KB
memory.c -rw-r--r-- 107.2 KB
memory_hotplug.c -rw-r--r-- 23.9 KB
mempolicy.c -rw-r--r-- 64.3 KB
mempool.c -rw-r--r-- 8.9 KB
migrate.c -rw-r--r-- 31.6 KB
mincore.c -rw-r--r-- 7.7 KB
mlock.c -rw-r--r-- 15.5 KB
mm_init.c -rw-r--r-- 3.7 KB
mmap.c -rw-r--r-- 69.3 KB
mmu_context.c -rw-r--r-- 1.4 KB
mmu_notifier.c -rw-r--r-- 9.1 KB
mmzone.c -rw-r--r-- 1.8 KB
mprotect.c -rw-r--r-- 7.9 KB
mremap.c -rw-r--r-- 13.2 KB
msync.c -rw-r--r-- 2.4 KB
nobootmem.c -rw-r--r-- 10.5 KB
nommu.c -rw-r--r-- 50.7 KB
oom_kill.c -rw-r--r-- 21.6 KB
page-writeback.c -rw-r--r-- 45.7 KB
page_alloc.c -rw-r--r-- 159.4 KB
page_cgroup.c -rw-r--r-- 12.9 KB
page_io.c -rw-r--r-- 3.2 KB
page_isolation.c -rw-r--r-- 3.6 KB
pagewalk.c -rw-r--r-- 5.7 KB
percpu-km.c -rw-r--r-- 2.8 KB
percpu-vm.c -rw-r--r-- 13.0 KB
percpu.c -rw-r--r-- 55.5 KB
pgtable-generic.c -rw-r--r-- 3.3 KB
prio_tree.c -rw-r--r-- 6.3 KB
quicklist.c -rw-r--r-- 2.4 KB
readahead.c -rw-r--r-- 15.1 KB
rmap.c -rw-r--r-- 50.1 KB
shmem.c -rw-r--r-- 78.2 KB
slab.c -rw-r--r-- 117.7 KB
slob.c -rw-r--r-- 17.1 KB
slub.c -rw-r--r-- 122.9 KB
sparse-vmemmap.c -rw-r--r-- 5.9 KB
sparse.c -rw-r--r-- 20.5 KB
swap.c -rw-r--r-- 19.9 KB
swap_state.c -rw-r--r-- 10.4 KB
swapfile.c -rw-r--r-- 65.2 KB
thrash.c -rw-r--r-- 3.9 KB
truncate.c -rw-r--r-- 17.6 KB
util.c -rw-r--r-- 7.3 KB
vmalloc.c -rw-r--r-- 64.0 KB
vmscan.c -rw-r--r-- 97.8 KB
vmstat.c -rw-r--r-- 33.1 KB

back to top