12 Jul, 2012
1 commit
-
Commit fd3142a59af2012a7c5dc72ec97a4935ff1c5fc6 broke
slob since a piece of a change for a later patch slipped into
it.Fengguang Wu writes:
The commit crashes the kernel w/o any dmesg output (the attached one is
created by the script as a summary for that run). This is very
reproducible in kvm for the attached config.Reported-by: Fengguang Wu
Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg
09 Jul, 2012
2 commits
-
All allocators have some sort of support for the bootstrap status.
Setup a common definition for the boot states and make all slab
allocators use that definition.Reviewed-by: Glauber Costa
Reviewed-by: Joonsoo Kim
Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg -
Kmem_cache_create() does a variety of sanity checks but those
vary depending on the allocator. Use the strictest tests and put them into
a slab_common file. Make the tests conditional on CONFIG_DEBUG_VM.This patch has the effect of adding sanity checks for SLUB and SLOB
under CONFIG_DEBUG_VM and removes the checks in SLAB for !CONFIG_DEBUG_VM.Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg
14 Jun, 2012
4 commits
-
Define a struct that describes common fields used in all slab allocators.
A slab allocator either uses the common definition (like SLOB) or is
required to provide members of kmem_cache with the definition given.After that it will be possible to share code that
only operates on those fields of kmem_cache.The patch basically takes the slob definition of kmem cache and
uses the field namees for the other allocators.It also standardizes the names used for basic object lengths in
allocators:object_size Struct size specified at kmem_cache_create. Basically
the payload expected to be used by the subsystem.size The size of memory allocator for each object. This size
is larger than object_size and includes padding, alignment
and extra metadata for each object (f.e. for debugging
and rcu).Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg -
Those have become so simple that they are no longer needed.
Reviewed-by: Joonsoo Kim
Acked-by: David Rientjes
signed-off-by: Christoph LameterSigned-off-by: Pekka Enberg
-
Reviewed-by: Joonsoo Kim
Acked-by: David Rientjes
Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg -
Define the fields used by slob in mm_types.h and use struct page instead
of struct slob_page in slob. This cleans up numerous of typecasts in slob.c and
makes readers aware of slob's use of page struct fields.[Also cleans up some bitrot in slob.c. The page struct field layout
in slob.c is an old layout and does not match the one in mm_types.h]Reviewed-by: Glauber Costa
Acked-by: David Rientjes
Reviewed-by: Joonsoo Kim
Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg
31 Oct, 2011
1 commit
-
The files changed within are only using the EXPORT_SYMBOL
macro variants. They are not using core modular infrastructure
and hence don't need module.h but only the export.h header.Signed-off-by: Paul Gortmaker
27 Jul, 2011
1 commit
-
This allows us to move duplicated code in
(atomic_inc_not_zero() for now) toSigned-off-by: Arun Sharma
Reviewed-by: Eric Dumazet
Cc: Ingo Molnar
Cc: David Miller
Cc: Eric Dumazet
Acked-by: Mike Frysinger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Jun, 2011
1 commit
-
Doing a ktest.pl randconfig, I stumbled across the following bug
on boot up:------------[ cut here ]------------
WARNING: at /home/rostedt/work/autotest/nobackup/linux-test.git/kernel/lockdep.c:2649 lockdep_trace_alloc+0xed/0x100()
Hardware name:
Modules linked in:
Pid: 0, comm: swapper Not tainted 3.0.0-rc1-test-00054-g1d68b67 #1
Call Trace:
[] warn_slowpath_common+0xad/0xf0
[] warn_slowpath_null+0x1a/0x20
[] lockdep_trace_alloc+0xed/0x100
[] __kmalloc_node+0x30/0x2f0
[] pcpu_mem_alloc+0x13a/0x180
[] percpu_init_late+0x48/0xc2
[] ? mem_init+0xd8/0xe3
[] start_kernel+0x1c2/0x449
[] x86_64_start_reservations+0x163/0x167
[] x86_64_start_kernel+0x133/0x142^M
---[ end trace a7919e7f17c0a725 ]---Then I ran a ktest.pl config_bisect and it came up with this config
as the problem:CONFIG_SLOB
Looking at what is different between SLOB and SLAB and SLUB, I found
that the gfp flags are masked against gfp_allowed_mask in
SLAB and SLUB, but not SLOB.On boot up, interrupts are disabled and lockdep will warn if some flags
are set in gfp and interrupts are disabled. But these flags are masked
off with the gfp_allowed_mask during boot. Because SLOB does not
mask the flags against gfp_allowed_mask it triggers the warn on.Adding this mask fixes the bug. I also found that kmem_cache_alloc_node()
was missing both the mask and the lockdep check, and that was added too.Acked-by: Matt Mackall
Cc: Paul Mundt
Cc: Nick Piggin
Signed-off-by: Steven Rostedt
Signed-off-by: Pekka Enberg
24 Jan, 2011
1 commit
-
The last user was ext4 and Eric Sandeen removed the call in a recent patch. See
the following URL for the discussion:http://marc.info/?l=linux-ext4&m=129546975702198&w=2
Signed-off-by: Christoph Lameter
Signed-off-by: Pekka Enberg
07 Jan, 2011
1 commit
-
This is a nasty and error prone API. It is no longer used, remove it.
Signed-off-by: Nick Piggin
02 Oct, 2010
1 commit
-
kmalloc_node() may allocate higher order slob pages, but the __GFP_COMP
bit is only passed to the page allocator and not represented in the
tracepoint event. The bit should be passed to trace_kmalloc_node() as
well.Acked-by: Matt Mackall
Reviewed-by: Christoph Lameter
Signed-off-by: David Rientjes
Signed-off-by: Pekka Enberg
07 Aug, 2010
2 commits
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
slub: Allow removal of slab caches during boot
Revert "slub: Allow removal of slab caches during boot"
slub numa: Fix rare allocation from unexpected node
slab: use deferable timers for its periodic housekeeping
slub: Use kmem_cache flags to detect if slab is in debugging mode.
slub: Allow removal of slab caches during boot
slub: Check kasprintf results in kmem_cache_init()
SLUB: Constants need UL
slub: Use a constant for a unspecified node.
SLOB: Free objects to their own list
slab: fix caller tracking on !CONFIG_DEBUG_SLAB && CONFIG_TRACING -
…git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (162 commits)
tracing/kprobes: unregister_trace_probe needs to be called under mutex
perf: expose event__process function
perf events: Fix mmap offset determination
perf, powerpc: fsl_emb: Restore setting perf_sample_data.period
perf, powerpc: Convert the FSL driver to use local64_t
perf tools: Don't keep unreferenced maps when unmaps are detected
perf session: Invalidate last_match when removing threads from rb_tree
perf session: Free the ref_reloc_sym memory at the right place
x86,mmiotrace: Add support for tracing STOS instruction
perf, sched migration: Librarize task states and event headers helpers
perf, sched migration: Librarize the GUI class
perf, sched migration: Make the GUI class client agnostic
perf, sched migration: Make it vertically scrollable
perf, sched migration: Parameterize cpu height and spacing
perf, sched migration: Fix key bindings
perf, sched migration: Ignore unhandled task states
perf, sched migration: Handle ignored migrate out events
perf: New migration tool overview
tracing: Drop cpparg() macro
perf: Use tracepoint_synchronize_unregister() to flush any pending tracepoint call
...Fix up trivial conflicts in Makefile and drivers/cpufreq/cpufreq.c
16 Jul, 2010
1 commit
-
SLOB has alloced smaller objects from their own list in reduce overall external
fragmentation and increase repeatability, free to their own list also.This is /proc/meminfo result in my test machine:
without this patch:
===
MemTotal: 1030720 kB
MemFree: 750012 kB
Buffers: 15496 kB
Cached: 160396 kB
SwapCached: 0 kB
Active: 105024 kB
Inactive: 145604 kB
Active(anon): 74816 kB
Inactive(anon): 2180 kB
Active(file): 30208 kB
Inactive(file): 143424 kB
Unevictable: 16 kB
....with this patch:
===
MemTotal: 1030720 kB
MemFree: 751908 kB
Buffers: 15492 kB
Cached: 160280 kB
SwapCached: 0 kB
Active: 102720 kB
Inactive: 146140 kB
Active(anon): 73168 kB
Inactive(anon): 2180 kB
Active(file): 29552 kB
Inactive(file): 143960 kB
Unevictable: 16 kB
...The result shows an improvement of 1 MB!
And when I tested it on a embeded system with 64 MB, I found this path is never
called during kernel bootup.Acked-by: Matt Mackall
Signed-off-by: Bob Liu
Signed-off-by: Pekka Enberg
15 Jun, 2010
1 commit
-
Remove all rcu head inits. We don't care about the RCU head state before passing
it to call_rcu() anyway. Only leave the "on_stack" variants so debugobjects can
keep track of objects on stack.Signed-off-by: Alexey Dobriyan
Signed-off-by: Mathieu Desnoyers
Signed-off-by: Paul E. McKenney
Cc: Christoph Lameter
Cc: Pekka Enberg
Cc: Matt Mackall
Cc: Andrew Morton
09 Jun, 2010
1 commit
-
We have been resisting new ftrace plugins and removing existing
ones, and kmemtrace has been superseded by kmem trace events
and perf-kmem, so we remove it.Signed-off-by: Li Zefan
Acked-by: Pekka Enberg
Acked-by: Eduard - Gabriel Munteanu
Cc: Ingo Molnar
Cc: Steven Rostedt
[ remove kmemtrace from the makefile, handle slob too ]
Signed-off-by: Frederic Weisbecker
20 May, 2010
1 commit
-
Acked-by: Herbert Xu
Signed-off-by: David Woodhouse
Signed-off-by: Pekka Enberg
06 Aug, 2009
1 commit
-
kmem_cache_init_late() has been declared in slab.h
CC: Nick Piggin
CC: Matt Mackall
CC: Christoph Lameter
Signed-off-by: Wu Fengguang
Signed-off-by: Pekka Enberg
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
17 Jun, 2009
2 commits
-
Callers of alloc_pages_node() can optionally specify -1 as a node to mean
"allocate from the current node". However, a number of the callers in
fast paths know for a fact their node is valid. To avoid a comparison and
branch, this patch adds alloc_pages_exact_node() that only checks the nid
with VM_BUG_ON(). Callers that know their node is valid are then
converted.Signed-off-by: Mel Gorman
Reviewed-by: Christoph Lameter
Reviewed-by: KOSAKI Motohiro
Reviewed-by: Pekka Enberg
Acked-by: Paul Mundt [for the SLOB NUMA bits]
Cc: Peter Zijlstra
Cc: Nick Piggin
Cc: Dave Hansen
Cc: Lee Schermerhorn
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jun, 2009
1 commit
-
This patch adds the callbacks to kmemleak_(alloc|free) functions from the
slob allocator.Signed-off-by: Catalin Marinas
Acked-by: Matt Mackall
Acked-by: Pekka Enberg
11 Jun, 2009
1 commit
-
* 'tracing-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (244 commits)
Revert "x86, bts: reenable ptrace branch trace support"
tracing: do not translate event helper macros in print format
ftrace/documentation: fix typo in function grapher name
tracing/events: convert block trace points to TRACE_EVENT(), fix !CONFIG_BLOCK
tracing: add protection around module events unload
tracing: add trace_seq_vprint interface
tracing: fix the block trace points print size
tracing/events: convert block trace points to TRACE_EVENT()
ring-buffer: fix ret in rb_add_time_stamp
ring-buffer: pass in lockdep class key for reader_lock
tracing: add annotation to what type of stack trace is recorded
tracing: fix multiple use of __print_flags and __print_symbolic
tracing/events: fix output format of user stack
tracing/events: fix output format of kernel stack
tracing/trace_stack: fix the number of entries in the header
ring-buffer: discard timestamps that are at the start of the buffer
ring-buffer: try to discard unneeded timestamps
ring-buffer: fix bug in ring_buffer_discard_commit
ftrace: do not profile functions when disabled
tracing: make trace pipe recognize latency format flag
...
11 May, 2009
1 commit
-
For the sake of consistency.
Signed-off-by: Wu Fengguang
Cc: KOSAKI Motohiro
Cc: Andi Kleen
Acked-by: Matt Mackall
Cc: Alexey Dobriyan
Cc: Ingo Molnar
Cc: Christoph Lameter
Signed-off-by: Andrew Morton
Signed-off-by: Pekka Enberg
06 May, 2009
1 commit
-
SLOB does not correctly account reclaim_state.reclaimed_slab, so it will
break memory reclaim. Account it like SLAB does.Cc: stable@kernel.org
Cc: linux-mm@kvack.org
Acked-by: Matt Mackall
Acked-by: Christoph Lameter
Signed-off-by: Nick Piggin
Signed-off-by: Pekka Enberg
12 Apr, 2009
1 commit
-
Impact: refactor code for future changes
Current kmemtrace.h is used both as header file of kmemtrace and kmem's
tracepoints definition.Tracepoints' definition file may be used by other code, and should only have
definition of tracepoint.We can separate include/trace/kmemtrace.h into 2 files:
include/linux/kmemtrace.h: header file for kmemtrace
include/trace/kmem.h: definition of kmem tracepointsSigned-off-by: Zhao Lei
Acked-by: Eduard - Gabriel Munteanu
Acked-by: Pekka Enberg
Cc: Steven Rostedt
Cc: Frederic Weisbecker
Cc: Tom Zanussi
LKML-Reference:
Signed-off-by: Ingo Molnar
03 Apr, 2009
2 commits
-
Impact: also output kfree(NULL) entries
This patch moves the trace_kfree() calls before the ZERO_OR_NULL_PTR
check so that we can trace call-sites that call kfree() with NULL many
times which might be an indication of a bug.Signed-off-by: Pekka Enberg
Cc: Eduard - Gabriel Munteanu
LKML-Reference:
Signed-off-by: Ingo Molnar -
kmemtrace now uses tracepoints instead of markers. We no longer need to
use format specifiers to pass arguments.Signed-off-by: Eduard - Gabriel Munteanu
[ folded: Use the new TP_PROTO and TP_ARGS to fix the build. ]
[ folded: fix build when CONFIG_KMEMTRACE is disabled. ]
[ folded: define tracepoints when CONFIG_TRACEPOINTS is enabled. ]
Signed-off-by: Pekka Enberg
LKML-Reference:
Signed-off-by: Ingo Molnar
02 Apr, 2009
1 commit
-
Conflicts:
include/linux/slub_def.h
lib/Kconfig.debug
mm/slob.c
mm/slub.c
31 Mar, 2009
2 commits
-
* 'locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (33 commits)
lockdep: fix deadlock in lockdep_trace_alloc
lockdep: annotate reclaim context (__GFP_NOFS), fix SLOB
lockdep: annotate reclaim context (__GFP_NOFS), fix
lockdep: build fix for !PROVE_LOCKING
lockstat: warn about disabled lock debugging
lockdep: use stringify.h
lockdep: simplify check_prev_add_irq()
lockdep: get_user_chars() redo
lockdep: simplify get_user_chars()
lockdep: add comments to mark_lock_irq()
lockdep: remove macro usage from mark_held_locks()
lockdep: fully reduce mark_lock_irq()
lockdep: merge the !_READ mark_lock_irq() helpers
lockdep: merge the _READ mark_lock_irq() helpers
lockdep: simplify mark_lock_irq() helpers #3
lockdep: further simplify mark_lock_irq() helpers
lockdep: simplify the mark_lock_irq() helpers
lockdep: split up mark_lock_irq()
lockdep: generate usage strings
lockdep: generate the state bit definitions
... -
Impact: build fix
fix typo in mm/slob.c:
mm/slob.c:469: error: ‘flags’ undeclared (first use in this function)
mm/slob.c:469: error: (Each undeclared identifier is reported only once
mm/slob.c:469: error: for each function it appears in.)Cc: Nick Piggin
Cc: Peter Zijlstra
LKML-Reference:
Signed-off-by: Ingo Molnar
24 Mar, 2009
1 commit
-
…pic/slub/cleanups' and 'topic/slub/perf' into for-linus
23 Mar, 2009
1 commit
-
Don't hold SLOB lock when freeing the page. Reduces lock hold width. See
the following thread for discussion of the bug:http://marc.info/?l=linux-kernel&m=123709983214143&w=2
Reported-by: Ingo Molnar
Acked-by: Matt Mackall
Signed-off-by: Nick Piggin
Signed-off-by: Pekka Enberg
05 Mar, 2009
1 commit
15 Feb, 2009
1 commit
-
Here is another version, with the incremental patch rolled up, and
added reclaim context annotation to kswapd, and allocation tracing
to slab allocators (which may only ever reach the page allocator
in rare cases, so it is good to put annotations here too).Haven't tested this version as such, but it should be getting closer
to merge worthy ;)--
After noticing some code in mm/filemap.c accidentally perform a __GFP_FS
allocation when it should not have been, I thought it might be a good idea to
try to catch this kind of thing with lockdep.I coded up a little idea that seems to work. Unfortunately the system has to
actually be in __GFP_FS page reclaim, then take the lock, before it will mark
it. But at least that might still be some orders of magnitude more common
(and more debuggable) than an actual deadlock condition, so we have some
improvement I hope (the concept is no less complete than discovery of a lock's
interrupt contexts).I guess we could even do the same thing with __GFP_IO (normal reclaim), and
even GFP_NOIO locks too... but filesystems will have the most locks and fiddly
code paths, so let's start there and see how it goes.It *seems* to work. I did a quick test.
=================================
[ INFO: inconsistent lock state ]
2.6.28-rc6-00007-ged31348-dirty #26
---------------------------------
inconsistent {in-reclaim-W} -> {ov-reclaim-W} usage.
modprobe/8526 [HC0[0]:SC0[0]:HE1:SE1] takes:
(testlock){--..}, at: [] brd_init+0x55/0x216 [brd]
{in-reclaim-W} state was registered at:
[] __lock_acquire+0x75b/0x1a60
[] lock_acquire+0x91/0xc0
[] mutex_lock_nested+0xb1/0x310
[] brd_init+0x2b/0x216 [brd]
[] _stext+0x3b/0x170
[] sys_init_module+0xaf/0x1e0
[] system_call_fastpath+0x16/0x1b
[] 0xffffffffffffffff
irq event stamp: 3929
hardirqs last enabled at (3929): [] mutex_lock_nested+0x285/0x310
hardirqs last disabled at (3928): [] mutex_lock_nested+0x59/0x310
softirqs last enabled at (3732): [] sk_filter+0x83/0xe0
softirqs last disabled at (3730): [] sk_filter+0x16/0xe0other info that might help us debug this:
1 lock held by modprobe/8526:
#0: (testlock){--..}, at: [] brd_init+0x55/0x216 [brd]stack backtrace:
Pid: 8526, comm: modprobe Not tainted 2.6.28-rc6-00007-ged31348-dirty #26
Call Trace:
[] print_usage_bug+0x193/0x1d0
[] mark_lock+0xaf0/0xca0
[] mark_held_locks+0x55/0xc0
[] ? brd_init+0x0/0x216 [brd]
[] trace_reclaim_fs+0x2a/0x60
[] __alloc_pages_internal+0x475/0x580
[] ? mutex_lock_nested+0x26e/0x310
[] ? brd_init+0x0/0x216 [brd]
[] brd_init+0x6a/0x216 [brd]
[] ? brd_init+0x0/0x216 [brd]
[] _stext+0x3b/0x170
[] ? mutex_unlock+0x9/0x10
[] ? __mutex_unlock_slowpath+0x10d/0x180
[] ? trace_hardirqs_on_caller+0x12c/0x190
[] sys_init_module+0xaf/0x1e0
[] system_call_fastpath+0x16/0x1bSigned-off-by: Nick Piggin
Signed-off-by: Peter Zijlstra
Signed-off-by: Ingo Molnar
13 Feb, 2009
1 commit
-
…ing/urgent' and 'linus' into tracing/core
12 Feb, 2009
1 commit
-
Commit 7b2cd92adc5430b0c1adeb120971852b4ea1ab08 ("crypto: api - Fix
zeroing on free") added modular user of ksize(). Export that to fix
crypto.ko compilation.Cc: Herbert Xu
Signed-off-by: Kirill A. Shutemov
Signed-off-by: Pekka Enberg
19 Jan, 2009
1 commit
-
- Use NULL instead of plain 0;
- Rename slob_page() to is_slob_page();
- Define slob_page() to convert void* to struct slob_page*;
- Rename slob_new_page() to slob_new_pages();
- Define slob_free_pages() accordingly.Compile tests only.
Signed-off-by: WANG Cong
Signed-off-by: Matt Mackall
Cc: Christoph Lameter
Signed-off-by: Pekka Enberg