15 Dec, 2009
1 commit
-
…/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf sched: Fix build failure on sparc
perf bench: Add "all" pseudo subsystem and "all" pseudo suite
perf tools: Introduce perf_session class
perf symbols: Ditch dso->find_symbol
perf symbols: Allow lookups by symbol name too
perf symbols: Add missing "Variables" entry to map_type__name
perf symbols: Add support for 'variable' symtabs
perf symbols: Introduce ELF counterparts to symbol_type__is_a
perf symbols: Introduce symbol_type__is_a
perf symbols: Rename kthreads to kmaps, using another abstraction for it
perf tools: Allow building for ARM
hw-breakpoints: Handle bad modify_user_hw_breakpoint off-case return value
perf tools: Allow cross compiling
tracing, slab: Fix no callsite ifndef CONFIG_KMEMTRACE
tracing, slab: Define kmem_cache_alloc_notrace ifdef CONFIG_TRACINGTrivial conflict due to different fixes to modify_user_hw_breakpoint()
in include/linux/hw_breakpoint.h
12 Dec, 2009
1 commit
11 Dec, 2009
1 commit
-
Define kmem_trace_alloc_{,node}_notrace() if CONFIG_TRACING is
enabled, otherwise perf-kmem will show wrong stats ifndef
CONFIG_KMEM_TRACE, because a kmalloc() memory allocation may
be traced by both trace_kmalloc() and trace_kmem_cache_alloc().Signed-off-by: Li Zefan
Reviewed-by: Pekka Enberg
Cc: Christoph Lameter
Cc: Steven Rostedt
Cc: Frederic Weisbecker
Cc: linux-mm@kvack.org
Cc: Eduard - Gabriel Munteanu
LKML-Reference:
Signed-off-by: Ingo Molnar
29 Nov, 2009
1 commit
-
The unlikely() annotation in slab_alloc() covers too much of the expression.
It's actually very likely that the object is not NULL so use unlikely() only
for the __GFP_ZERO expression like SLAB does.The patch reduces kernel text by 29 bytes on x86-64:
text data bss dec hex filename
24185 8560 176 32921 8099 mm/slub.o.orig
24156 8560 176 32892 807c mm/slub.oAcked-by: Christoph Lameter
Signed-off-by: Pekka Enberg
16 Oct, 2009
1 commit
-
When collecting slub stats for particular workloads, it's necessary to
collect each statistic for all caches before the job is even started
because the counters are usually greater than zero just from boot and
initialization.This allows a statistic to be cleared on each cpu by writing '0' to its
sysfs file. This creates a baseline for statistics of interest before
the workload is started.Setting a statistic to a particular value is not supported, so all values
written to these files other than '0' returns -EINVAL.Cc: Christoph Lameter
Signed-off-by: David Rientjes
Signed-off-by: Pekka Enberg
22 Sep, 2009
1 commit
-
Right now, if you inadvertently pass NULL to kmem_cache_create() at boot
time, it crashes much later after boot somewhere deep inside sysfs which
makes it very non obvious to figure out what's going on.Signed-off-by: Benjamin Herrenschmidt
Cc: Pekka Enberg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Sep, 2009
2 commits
-
This build bug:
mm/slub.c: In function 'kmem_cache_open':
mm/slub.c:2476: error: 'disable_higher_order_debug' undeclared (first use in this function)
mm/slub.c:2476: error: (Each undeclared identifier is reported only once
mm/slub.c:2476: error: for each function it appears in.)Triggers because there's no !CONFIG_SLUB_DEBUG definition for
disable_higher_order_debug.Signed-off-by: Ingo Molnar
Signed-off-by: Pekka Enberg -
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (46 commits)
powerpc64: convert to dynamic percpu allocator
sparc64: use embedding percpu first chunk allocator
percpu: kill lpage first chunk allocator
x86,percpu: use embedding for 64bit NUMA and page for 32bit NUMA
percpu: update embedding first chunk allocator to handle sparse units
percpu: use group information to allocate vmap areas sparsely
vmalloc: implement pcpu_get_vm_areas()
vmalloc: separate out insert_vmalloc_vm()
percpu: add chunk->base_addr
percpu: add pcpu_unit_offsets[]
percpu: introduce pcpu_alloc_info and pcpu_group_info
percpu: move pcpu_lpage_build_unit_map() and pcpul_lpage_dump_cfg() upward
percpu: add @align to pcpu_fc_alloc_fn_t
percpu: make @dyn_size mandatory for pcpu_setup_first_chunk()
percpu: drop @static_size from first chunk allocators
percpu: generalize first chunk allocator selection
percpu: build first chunk allocators selectively
percpu: rename 4k first chunk allocator to page
percpu: improve boot messages
percpu: fix pcpu_reclaim() locking
...Fix trivial conflict as by Tejun Heo in kernel/sched.c
15 Sep, 2009
1 commit
14 Sep, 2009
1 commit
-
When SLAB_POISON is used and slab_pad_check() finds an overwrite of the
slab padding, we call restore_bytes() on the whole slab, not only
on the padding.Acked-by: Christoph Lameer
Reported-by: Zdenek Kabelac
Signed-off-by: Eric Dumazet
Signed-off-by: Pekka Enberg
04 Sep, 2009
2 commits
-
kmem_cache_destroy() should call rcu_barrier() *after* kmem_cache_close() and
*before* sysfs_slab_remove() or risk rcu_free_slab() being called after
kmem_cache is deleted (kfreed).rmmod nf_conntrack can crash the machine because it has to kmem_cache_destroy()
a SLAB_DESTROY_BY_RCU enabled cache.Cc:
Reported-by: Zdenek Kabelac
Signed-off-by: Eric Dumazet
Acked-by: Paul E. McKenney
Signed-off-by: Pekka Enberg -
When CONFIG_SLUB_DEBUG is enabled, sysfs_slab_add should unlink and put the
kobject if sysfs_create_group failed. Otherwise, sysfs_slab_add returns error
then free kmem_cache s, thus memory of s->kobj is leaked.Acked-by: Christoph Lameter
Signed-off-by: Xiaotian Feng
Signed-off-by: Pekka Enberg
30 Aug, 2009
1 commit
-
If the minalign is 64 bytes, then the 96 byte cache should not be created
because it would conflict with the 128 byte cache.If the minalign is 256 bytes, patching the size_index table should not
result in a buffer overrun.The calculation "(i - 1) / 8" used to access size_index[] is moved to
a separate function as suggested by Christoph Lameter.Acked-by: Christoph Lameter
Signed-off-by: Aaro Koskinen
Signed-off-by: Pekka Enberg
20 Aug, 2009
1 commit
-
Signed-off-by: WANG Cong
Signed-off-by: Pekka Enberg
19 Aug, 2009
1 commit
-
SLUB does not support writes to /proc/slabinfo so there should not be write
permission to do that either.Signed-off-by: WANG Cong
Signed-off-by: Pekka Enberg
14 Aug, 2009
1 commit
-
Conflicts:
arch/sparc/kernel/smp_64.c
arch/x86/kernel/cpu/perf_counter.c
arch/x86/kernel/setup_percpu.c
drivers/cpufreq/cpufreq_ondemand.c
mm/percpu.cConflicts in core and arch percpu codes are mostly from commit
ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
num_possible_cpus() with nr_cpu_ids. As for-next branch has moved all
the first chunk allocators into mm/percpu.c, the changes are moved
from arch code to mm/percpu.c.Signed-off-by: Tejun Heo
01 Aug, 2009
1 commit
-
kmem_cache->align records the original align parameter value specified
by users. Function calculate_alignment might change it based on cache
line size. So change kmem_cache->align correspondingly.Signed-off-by: Zhang Yanmin
Signed-off-by: Pekka Enberg
28 Jul, 2009
1 commit
-
This patch moves the masking of debugging flags which increase a cache's
min order due to metadata when `slub_debug=O' is used from
kmem_cache_flags() to kmem_cache_open().Instead of defining the maximum metadata size increase in a preprocessor
macro, this approach uses the cache's ->size and ->objsize members to
determine if the min order increased due to debugging options. If so,
the flags specified in the more appropriately named DEBUG_METADATA_FLAGS
are masked off.This approach was suggested by Christoph Lameter
.Cc: Christoph Lameter
Signed-off-by: David Rientjes
Signed-off-by: Pekka Enberg
10 Jul, 2009
1 commit
-
When debugging is enabled, slub requires that additional metadata be
stored in slabs for certain options: SLAB_RED_ZONE, SLAB_POISON, and
SLAB_STORE_USER.Consequently, it may require that the minimum possible slab order needed
to allocate a single object be greater when using these options. The
most notable example is for objects that are PAGE_SIZE bytes in size.Higher minimum slab orders may cause page allocation failures when oom or
under heavy fragmentation.This patch adds a new slub_debug option, which disables debugging by
default for caches that would have resulted in higher minimum orders:slub_debug=O
When this option is used on systems with 4K pages, kmalloc-4096, for
example, will not have debugging enabled by default even if
CONFIG_SLUB_DEBUG_ON is defined because it would have resulted in a
order-1 minimum slab order.Reported-by: Larry Finger
Tested-by: Larry Finger
Cc: Christoph Lameter
Signed-off-by: David Rientjes
Signed-off-by: Pekka Enberg
08 Jul, 2009
1 commit
-
The kmalloc_large() and kmalloc_large_node() functions were missed when
adding the kmemleak hooks to the slub allocator. However, they should be
traced to avoid false positives.Signed-off-by: Catalin Marinas
Cc: Christoph Lameter
Acked-by: Pekka Enberg
04 Jul, 2009
1 commit
-
Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix
changes. As alpha in percpu tree uses 'weak' attribute instead of
inline assembly, there's no need for __used attribute.Conflicts:
arch/alpha/include/asm/percpu.h
arch/mn10300/kernel/vmlinux.lds.S
include/linux/percpu-defs.h
26 Jun, 2009
1 commit
-
Jesper noted that kmem_cache_destroy() invokes synchronize_rcu() rather than
rcu_barrier() in the SLAB_DESTROY_BY_RCU case, which could result in RCU
callbacks accessing a kmem_cache after it had been destroyed.Cc:
Acked-by: Matt Mackall
Reported-by: Jesper Dangaard Brouer
Signed-off-by: Paul E. McKenney
Signed-off-by: Pekka Enberg
25 Jun, 2009
1 commit
-
SLUB uses higher order allocations by default but falls back to small
orders under memory pressure. Make sure the GFP mask used in the initial
allocation doesn't include __GFP_NOFAIL.Signed-off-by: Pekka Enberg
Signed-off-by: Linus Torvalds
24 Jun, 2009
1 commit
-
Currently, the following three different ways to define percpu arrays
are in use.1. DEFINE_PER_CPU(elem_type[array_len], array_name);
2. DEFINE_PER_CPU(elem_type, array_name[array_len]);
3. DEFINE_PER_CPU(elem_type, array_name)[array_len];Unify to #1 which correctly separates the roles of the two parameters
and thus allows more flexibility in the way percpu variables are
defined.[ Impact: cleanup ]
Signed-off-by: Tejun Heo
Reviewed-by: Christoph Lameter
Cc: Ingo Molnar
Cc: Tony Luck
Cc: Benjamin Herrenschmidt
Cc: Thomas Gleixner
Cc: Jeremy Fitzhardinge
Cc: linux-mm@kvack.org
Cc: Christoph Lameter
Cc: David S. Miller
19 Jun, 2009
1 commit
-
The page allocator also needs the masking of gfp flags during boot,
so this moves it out of slab/slub and uses it with the page allocator
as well.Signed-off-by: Benjamin Herrenschmidt
Acked-by: Pekka Enberg
Signed-off-by: Linus Torvalds
17 Jun, 2009
4 commits
-
Conflicts:
mm/slub.c -
* akpm: (182 commits)
fbdev: bf54x-lq043fb: use kzalloc over kmalloc/memset
fbdev: *bfin*: fix __dev{init,exit} markings
fbdev: *bfin*: drop unnecessary calls to memset
fbdev: bfin-t350mcqb-fb: drop unused local variables
fbdev: blackfin has __raw I/O accessors, so use them in fb.h
fbdev: s1d13xxxfb: add accelerated bitblt functions
tcx: use standard fields for framebuffer physical address and length
fbdev: add support for handoff from firmware to hw framebuffers
intelfb: fix a bug when changing video timing
fbdev: use framebuffer_release() for freeing fb_info structures
radeon: P2G2CLK_ALWAYS_ONb tested twice, should 2nd be P2G2CLK_DAC_ALWAYS_ONb?
s3c-fb: CPUFREQ frequency scaling support
s3c-fb: fix resource releasing on error during probing
carminefb: fix possible access beyond end of carmine_modedb[]
acornfb: remove fb_mmap function
mb862xxfb: use CONFIG_OF instead of CONFIG_PPC_OF
mb862xxfb: restrict compliation of platform driver to PPC
Samsung SoC Framebuffer driver: add Alpha Channel support
atmel-lcdc: fix pixclock upper bound detection
offb: use framebuffer_alloc() to allocate fb_info struct
...Manually fix up conflicts due to kmemcheck in mm/slab.c
-
num_online_nodes() is called in a number of places but most often by the
page allocator when deciding whether the zonelist needs to be filtered
based on cpusets or the zonelist cache. This is actually a heavy function
and touches a number of cache lines.This patch stores the number of online nodes at boot time and updates the
value when nodes get onlined and offlined. The value is then used in a
number of important paths in place of num_online_nodes().[rientjes@google.com: do not override definition of node_set_online() with macro]
Signed-off-by: Christoph Lameter
Signed-off-by: Mel Gorman
Cc: KOSAKI Motohiro
Cc: Pekka Enberg
Cc: Peter Zijlstra
Cc: Nick Piggin
Cc: Dave Hansen
Cc: Lee Schermerhorn
Signed-off-by: David Rientjes
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Jun, 2009
4 commits
-
Conflicts:
MAINTAINERSSigned-off-by: Vegard Nossum
-
This adds support for tracking the initializedness of memory that
was allocated with the page allocator. Highmem requests are not
tracked.Cc: Dave Hansen
Acked-by: Pekka Enberg[build fix for !CONFIG_KMEMCHECK]
Signed-off-by: Ingo Molnar[rebased for mainline inclusion]
Signed-off-by: Vegard Nossum -
Recent change to use slab allocations earlier exposed a bug where
SLUB can call schedule_work and try to call sysfs before it is
safe to do so.Reported-by: Heiko Carstens
Tested-by: Heiko Carstens
Signed-off-by: Nick Piggin
Signed-off-by: Pekka Enberg -
Parts of this patch were contributed by Pekka Enberg but merged for
atomicity.Cc: Christoph Lameter
Signed-off-by: Vegard Nossum
Signed-off-by: Pekka Enberg
Signed-off-by: Ingo Molnar[rebased for mainline inclusion]
Signed-off-by: Vegard Nossum
14 Jun, 2009
2 commits
-
We must check for __GFP_NOFAIL like the page allocator does; otherwise we end
up with false positives. While at it, add the printk_ratelimit() check in SLUB
as well.Cc: Alexander Beregalov
Signed-off-by: Pekka Enberg -
Fix this build error when CONFIG_SLUB_DEBUG is not set:
mm/slub.c: In function 'slab_out_of_memory':
mm/slub.c:1551: error: 'struct kmem_cache_node' has no member named 'nr_slabs'
mm/slub.c:1552: error: 'struct kmem_cache_node' has no member named 'total_objects'[ penberg@cs.helsinki.fi: cleanups ]
Signed-off-by: Alexander Beregalov
Signed-off-by: Pekka Enberg
12 Jun, 2009
4 commits
-
As explained by Benjamin Herrenschmidt:
Oh and btw, your patch alone doesn't fix powerpc, because it's missing
a whole bunch of GFP_KERNEL's in the arch code... You would have to
grep the entire kernel for things that check slab_is_available() and
even then you'll be missing some.For example, slab_is_available() didn't always exist, and so in the
early days on powerpc, we used a mem_init_done global that is set form
mem_init() (not perfect but works in practice). And we still have code
using that to do the test.Therefore, mask out __GFP_WAIT, __GFP_IO, and __GFP_FS in the slab allocators
in early boot code to avoid enabling interrupts.Signed-off-by: Pekka Enberg
-
* 'for-linus' of git://linux-arm.org/linux-2.6:
kmemleak: Add the corresponding MAINTAINERS entry
kmemleak: Simple testing module for kmemleak
kmemleak: Enable the building of the memory leak detector
kmemleak: Remove some of the kmemleak false positives
kmemleak: Add modules support
kmemleak: Add kmemleak_alloc callback from alloc_large_system_hash
kmemleak: Add the vmalloc memory allocation/freeing hooks
kmemleak: Add the slub memory allocation/freeing hooks
kmemleak: Add the slob memory allocation/freeing hooks
kmemleak: Add the slab memory allocation/freeing hooks
kmemleak: Add documentation on the memory leak detector
kmemleak: Add the base supportManual conflict resolution (with the slab/earlyboot changes) in:
drivers/char/vt.c
init/main.c
mm/slab.c -
This patch makes kmalloc() available earlier in the boot sequence so we can get
rid of some bootmem allocations. The bulk of the changes are due to
kmem_cache_init() being called with interrupts disabled which requires some
changes to allocator boostrap code.Note: 32-bit x86 does WP protect test in mem_init() so we must setup traps
before we call mem_init() during boot as reported by Ingo Molnar:We have a hard crash in the WP-protect code:
[ 0.000000] Checking if this processor honours the WP bit even in supervisor mode...BUG: Int 14: CR2 ffcff000
[ 0.000000] EDI 00000188 ESI 00000ac7 EBP c17eaf9c ESP c17eaf8c
[ 0.000000] EBX 000014e0 EDX 0000000e ECX 01856067 EAX 00000001
[ 0.000000] err 00000003 EIP c10135b1 CS 00000060 flg 00010002
[ 0.000000] Stack: c17eafa8 c17fd410 c16747bc c17eafc4 c17fd7e5 000011fd f8616000 c18237cc
[ 0.000000] 00099800 c17bb000 c17eafec c17f1668 000001c5 c17f1322 c166e039 c1822bf0
[ 0.000000] c166e033 c153a014 c18237cc 00020800 c17eaff8 c17f106a 00020800 01ba5003
[ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.30-tip-02161-g7a74539-dirty #52203
[ 0.000000] Call Trace:
[ 0.000000] [] ? printk+0x14/0x16
[ 0.000000] [] ? do_test_wp_bit+0x19/0x23
[ 0.000000] [] ? test_wp_bit+0x26/0x64
[ 0.000000] [] ? mem_init+0x1ba/0x1d8
[ 0.000000] [] ? start_kernel+0x164/0x2f7
[ 0.000000] [] ? unknown_bootoption+0x0/0x19c
[ 0.000000] [] ? __init_begin+0x6a/0x6fAcked-by: Johannes Weiner
Acked-by Linus Torvalds
Cc: Christoph Lameter
Cc: Ingo Molnar
Cc: Matt Mackall
Cc: Nick Piggin
Cc: Yinghai Lu
Signed-off-by: Pekka Enberg -
This patch adds the callbacks to kmemleak_(alloc|free) functions from the
slub allocator.Signed-off-by: Catalin Marinas
Cc: Christoph Lameter
Reviewed-by: Pekka Enberg
11 Jun, 2009
1 commit
-
As suggested by Mel Gorman, add out-of-memory diagnostics to the SLUB allocator
to make debugging OOM conditions easier. This patch helped hunt down a nasty
OOM issue that popped up every now that was caused by SLUB debugging code which
forced 4096 byte allocations to use order 1 pages even in the fallback case.An example print out looks like this:
SLUB: Unable to allocate memory on node -1 (gfp=20)
cache: kmalloc-4096, object size: 4096, buffer size: 4168, default order: 3, min order: 1
node 0: slabs: 95, objs: 665, free: 0Acked-by: Christoph Lameter
Acked-by: Mel Gorman
Tested-by: Larry Finger
Signed-off-by: Pekka Enberg