<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/lib/debugobjects.c, branch linux-2.6.32.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.32.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.32.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2011-07-13T03:29:24Z</updated>
<entry>
<title>debugobjects: Fix boot crash when kmemleak and debugobjects enabled</title>
<updated>2011-07-13T03:29:24Z</updated>
<author>
<name>Marcin Slusarz</name>
<email>marcin.slusarz@gmail.com</email>
</author>
<published>2011-05-28T11:23:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=336fca97910371e16506e5448ad0ca9daae9a59c'/>
<id>urn:sha1:336fca97910371e16506e5448ad0ca9daae9a59c</id>
<content type='text'>
commit 161b6ae0e067e421b20bb35caf66bdb405c929ac upstream.

Order of initialization look like this:
...
debugobjects
kmemleak
...(lots of other subsystems)...
workqueues (through early initcall)
...

debugobjects use schedule_work for batch freeing of its data and kmemleak
heavily use debugobjects, so when it comes to freeing and workqueues were
not initialized yet, kernel crashes:

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [&lt;ffffffff810854d1&gt;] __queue_work+0x29/0x41a
 [&lt;ffffffff81085910&gt;] queue_work_on+0x16/0x1d
 [&lt;ffffffff81085abc&gt;] queue_work+0x29/0x55
 [&lt;ffffffff81085afb&gt;] schedule_work+0x13/0x15
 [&lt;ffffffff81242de1&gt;] free_object+0x90/0x95
 [&lt;ffffffff81242f6d&gt;] debug_check_no_obj_freed+0x187/0x1d3
 [&lt;ffffffff814b6504&gt;] ? _raw_spin_unlock_irqrestore+0x30/0x4d
 [&lt;ffffffff8110bd14&gt;] ? free_object_rcu+0x68/0x6d
 [&lt;ffffffff8110890c&gt;] kmem_cache_free+0x64/0x12c
 [&lt;ffffffff8110bd14&gt;] free_object_rcu+0x68/0x6d
 [&lt;ffffffff810b58bc&gt;] __rcu_process_callbacks+0x1b6/0x2d9
...

because system_wq is NULL.

Fix it by checking if workqueues susbystem was initialized before using.

Signed-off-by: Marcin Slusarz &lt;marcin.slusarz@gmail.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Dipankar Sarma &lt;dipankar@in.ibm.com&gt;
Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/r/20110528112342.GA3068@joi.lan
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>headers: remove sched.h from interrupt.h</title>
<updated>2009-10-11T18:20:58Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-10-07T13:09:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d43c36dc6b357fa1806800f18aa30123c747a6d1'/>
<id>urn:sha1:d43c36dc6b357fa1806800f18aa30123c747a6d1</id>
<content type='text'>
After m68k's task_thread_info() doesn't refer to current,
it's possible to remove sched.h from interrupt.h and not break m68k!
Many thanks to Heiko Carstens for allowing this.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
</content>
</entry>
<entry>
<title>debugobjects: delay free of internal objects</title>
<updated>2009-03-17T11:28:30Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-03-16T09:04:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=337fff8b5ed0573ea106491c6de47bd7fe623500'/>
<id>urn:sha1:337fff8b5ed0573ea106491c6de47bd7fe623500</id>
<content type='text'>
Impact: avoid recursive kfree calls, less slab activity on heavy load

debugobjects checks on kfree whether tracked objects are freed. When a
tracked object is freed debugobjects frees the internal reference
object as well. The debug object slab cache is marked to not recurse
into debugobjects when a slab objects is freed, but the recursive call
can be problematic versus locking in the memory allocator.

Defer the freeing of debug slab objects via schedule_work. The reasons
not to use RCU are:

1) rcu makes the data structure larger
2) there is no real need for rcu as nothing references the obj after
   we freed it
3) under heavy load it is easier to reuse the to be freed objects instead
   of allocating new objects from the slab. This lowered the slab activity
   significantly in a heavy load networking test where lots of timers are
   created/destroyed. The workqueue based delayed free allows us just to
   put the to be freed objects back into the object pool and reuse them
   right away.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
LKML-Reference: &lt;200903162049.58058.nickpiggin@yahoo.com.au&gt;
</content>
</entry>
<entry>
<title>debugobjects: replace static objects when slab cache becomes available</title>
<updated>2009-03-17T11:28:30Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-03-16T17:53:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1be1cb7b47f0744141ed61cdb25648819ae1a56f'/>
<id>urn:sha1:1be1cb7b47f0744141ed61cdb25648819ae1a56f</id>
<content type='text'>
Impact: refactor/consolidate object management, prepare for delayed free

debugobjects allocates static reference objects to track objects which
are initialized or activated before the slab cache becomes
available. These static reference objects have to be handled
seperately in free_object(). The handling of these objects is in the
way of implementing a delayed free functionality. The delayed free is
required to avoid callbacks into the mm code from
debug_check_no_obj_freed().

Replace the static object references with dynamic ones after the slab
cache has been initialized. The static objects are now marked initdata.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
LKML-Reference: &lt;200903162049.58058.nickpiggin@yahoo.com.au&gt;

</content>
</entry>
<entry>
<title>debug_objects: add boot-parameter toggle to turn object debugging off again</title>
<updated>2009-03-02T11:04:01Z</updated>
<author>
<name>Kyle McMartin</name>
<email>kyle@redhat.com</email>
</author>
<published>2009-03-02T01:41:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3e8ebb5c433f016dff5824587436642d87fc2e6c'/>
<id>urn:sha1:3e8ebb5c433f016dff5824587436642d87fc2e6c</id>
<content type='text'>
While trying to debug why my Atom netbook is falling over booting
rawhide debug-enabled kernels, I stumbled across the fact that we've
been enabling object debugging by default. However, once you default it
to on, you've got no way to turn it back off again at runtime.

Add a boolean toggle to turn it off. I would just make it an int
module_param, however people may already expect the boolean enable
behaviour, so just add an analogue for disabling.

Signed-off-by: Kyle McMartin &lt;kyle@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>debugobjects: add boot parameter default value</title>
<updated>2008-11-26T09:07:06Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-11-26T09:02:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3ae7020543db0b769538e64d1ce8d51fceff60ca'/>
<id>urn:sha1:3ae7020543db0b769538e64d1ce8d51fceff60ca</id>
<content type='text'>
Impact: add .config driven boot parameter default value

Right now debugobjects can only be activated if the debug_objects
boot parameter is passed in via the boot command line.

Make this more convenient (and randomizable) by also providing
a .config method. Enable it by default. (DEBUG_OBJECTS itself
is default-off)

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>debugobjects: fix lockdep warning</title>
<updated>2008-09-01T07:47:16Z</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@gmail.com</email>
</author>
<published>2008-08-31T21:39:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=673d62cc5ea6fca046650f17f77985b112c62322'/>
<id>urn:sha1:673d62cc5ea6fca046650f17f77985b112c62322</id>
<content type='text'>
Daniel J. Blueman reported:
&gt; =======================================================
&gt; [ INFO: possible circular locking dependency detected ]
&gt; 2.6.27-rc4-224c #1
&gt; -------------------------------------------------------
&gt; hald/4680 is trying to acquire lock:
&gt;  (&amp;n-&gt;list_lock){++..}, at: [&lt;ffffffff802bfa26&gt;] add_partial+0x26/0x80
&gt;
&gt; but task is already holding lock:
&gt;  (&amp;obj_hash[i].lock){++..}, at: [&lt;ffffffff8041cfdc&gt;]
&gt; debug_object_free+0x5c/0x120

We fix it by moving the actual freeing to outside the lock (the lock
now only protects the list).

The pool lock is also promoted to irq-safe (suggested by Dan). It's
necessary because free_pool is now called outside the irq disabled
region. So we need to protect against an interrupt handler which calls
debug_object_init().

[tglx@linutronix.de: added hlist_move_list helper to avoid looping
		     through the list twice]

Reported-by: Daniel J Blueman &lt;daniel.blueman@gmail.com&gt;
Signed-off-by: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>Use WARN() in lib/</title>
<updated>2008-07-26T19:00:07Z</updated>
<author>
<name>Arjan van de Ven</name>
<email>arjan@linux.intel.com</email>
</author>
<published>2008-07-26T02:45:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5cd2b459d326a424671dcd95f038649f7bf7cb96'/>
<id>urn:sha1:5cd2b459d326a424671dcd95f038649f7bf7cb96</id>
<content type='text'>
Use WARN() instead of a printk+WARN_ON() pair; this way the message becomes
part of the warning section for better reporting/collection.  In addition, one
of the if() clauses collapes into the WARN() entirely now.

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>add a helper function to test if an object is on the stack</title>
<updated>2008-07-24T17:47:14Z</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-07-24T04:26:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8b05c7e6e159d2f33c9275281b8b909a89eb7c5d'/>
<id>urn:sha1:8b05c7e6e159d2f33c9275281b8b909a89eb7c5d</id>
<content type='text'>
lib/debugobjects.c has a function to test if an object is on the stack.
The block layer and ide needs it (they need to avoid DMA from/to stack
buffers).  This patch moves the function to include/linux/sched.h so that
everyone can use it.

lib/debugobjects.c uses current-&gt;stack but this patch uses a
task_stack_page() accessor, which is a preferable way to access the stack.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Andy Whitcroft &lt;apw@shadowen.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>debugobjects: fix lockdep warning</title>
<updated>2008-06-18T09:09:54Z</updated>
<author>
<name>Vegard Nossum</name>
<email>vegard.nossum@gmail.com</email>
</author>
<published>2008-06-14T22:47:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=50db04dd9c74178e68a981a7127c37252ffb3242'/>
<id>urn:sha1:50db04dd9c74178e68a981a7127c37252ffb3242</id>
<content type='text'>
Daniel J Blueman reported:
| =======================================================
| [ INFO: possible circular locking dependency detected ]
| 2.6.26-rc5-201c #1
| -------------------------------------------------------
| nscd/3669 is trying to acquire lock:
|  (&amp;n-&gt;list_lock){.+..}, at: [&lt;ffffffff802bab03&gt;] deactivate_slab+0x173/0x1e0
|
| but task is already holding lock:
|  (&amp;obj_hash[i].lock){++..}, at: [&lt;ffffffff803fa56f&gt;]
| __debug_object_init+0x2f/0x350
|
| which lock already depends on the new lock.

There are two locks involved here; the first is a SLUB-local lock, and
the second is a debugobjects-local lock. They are basically taken in two
different orders:

1. SLUB { debugobjects { ... } }
2. debugobjects { SLUB { ... } }

This patch changes pattern #2 by trying to fill the memory pool (e.g.
the call into SLUB/kmalloc()) outside the debugobjects lock, so now the
two patterns look like this:

1. SLUB { debugobjects { ... } }
2. SLUB { } debugobjects { ... }

[ daniel.blueman@gmail.com: pool_lock needs to be taken irq safe in fill_pool ]

Reported-by: Daniel J Blueman &lt;daniel.blueman@gmail.com&gt;
Signed-off-by: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
</feed>
