<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/debugobjects.c, branch v4.14.219</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14.219</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14.219'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-12-17T08:28:54Z</updated>
<entry>
<title>debugobjects: avoid recursive calls with kmemleak</title>
<updated>2018-12-17T08:28:54Z</updated>
<author>
<name>Qian Cai</name>
<email>cai@gmx.us</email>
</author>
<published>2018-11-30T22:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=225b11374625aa4827fc1ee0b810c27dfe851809'/>
<id>urn:sha1:225b11374625aa4827fc1ee0b810c27dfe851809</id>
<content type='text'>
[ Upstream commit 8de456cf87ba863e028c4dd01bae44255ce3d835 ]

CONFIG_DEBUG_OBJECTS_RCU_HEAD does not play well with kmemleak due to
recursive calls.

fill_pool
  kmemleak_ignore
    make_black_object
      put_object
        __call_rcu (kernel/rcu/tree.c)
          debug_rcu_head_queue
            debug_object_activate
              debug_object_init
                fill_pool
                  kmemleak_ignore
                    make_black_object
                      ...

So add SLAB_NOLEAKTRACE to kmem_cache_create() to not register newly
allocated debug objects at all.

Link: http://lkml.kernel.org/r/20181126165343.2339-1-cai@gmx.us
Signed-off-by: Qian Cai &lt;cai@gmx.us&gt;
Suggested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Acked-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Yang Shi &lt;yang.shi@linux.alibaba.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>debugobjects: Make stack check warning more informative</title>
<updated>2018-09-15T07:45:35Z</updated>
<author>
<name>Joel Fernandes (Google)</name>
<email>joel@joelfernandes.org</email>
</author>
<published>2018-07-23T21:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8d015a362a84930994c99dd44bc7dc945520e05c'/>
<id>urn:sha1:8d015a362a84930994c99dd44bc7dc945520e05c</id>
<content type='text'>
commit fc91a3c4c27acdca0bc13af6fbb68c35cfd519f2 upstream.

While debugging an issue debugobject tracking warned about an annotation
issue of an object on stack. It turned out that the issue was due to the
object in concern being on a different stack which was due to another
issue.

Thomas suggested to print the pointers and the location of the stack for
the currently running task. This helped to figure out that the object was
on the wrong stack.

As this is general useful information for debugging similar issues, make
the error message more informative by printing the pointers.

[ tglx: Massaged changelog ]

Signed-off-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Acked-by: Yang Shi &lt;yang.shi@linux.alibaba.com&gt;
Cc: kernel-team@android.com
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: astrachan@google.com
Link: https://lkml.kernel.org/r/20180723212531.202328-1-joel@joelfernandes.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>debugobjects: Make kmemleak ignore debug objects</title>
<updated>2017-08-14T14:51:01Z</updated>
<author>
<name>Waiman Long</name>
<email>longman@redhat.com</email>
</author>
<published>2017-08-14T13:52:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=caba4cbbd27d755572730801ac34fe063fc40a32'/>
<id>urn:sha1:caba4cbbd27d755572730801ac34fe063fc40a32</id>
<content type='text'>
The allocated debug objects are either on the free list or in the
hashed bucket lists. So they won't get lost. However if both debug
objects and kmemleak are enabled and kmemleak scanning is done
while some of the debug objects are transitioning from one list to
the others, false negative reporting of memory leaks may happen for
those objects. For example,

[38687.275678] kmemleak: 12 new suspected memory leaks (see
/sys/kernel/debug/kmemleak)
unreferenced object 0xffff92e98aabeb68 (size 40):
  comm "ksmtuned", pid 4344, jiffies 4298403600 (age 906.430s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 d0 bc db 92 e9 92 ff ff  ................
    01 00 00 00 00 00 00 00 38 36 8a 61 e9 92 ff ff  ........86.a....
  backtrace:
    [&lt;ffffffff8fa5378a&gt;] kmemleak_alloc+0x4a/0xa0
    [&lt;ffffffff8f47c019&gt;] kmem_cache_alloc+0xe9/0x320
    [&lt;ffffffff8f62ed96&gt;] __debug_object_init+0x3e6/0x400
    [&lt;ffffffff8f62ef01&gt;] debug_object_activate+0x131/0x210
    [&lt;ffffffff8f330d9f&gt;] __call_rcu+0x3f/0x400
    [&lt;ffffffff8f33117d&gt;] call_rcu_sched+0x1d/0x20
    [&lt;ffffffff8f4a183c&gt;] put_object+0x2c/0x40
    [&lt;ffffffff8f4a188c&gt;] __delete_object+0x3c/0x50
    [&lt;ffffffff8f4a18bd&gt;] delete_object_full+0x1d/0x20
    [&lt;ffffffff8fa535c2&gt;] kmemleak_free+0x32/0x80
    [&lt;ffffffff8f47af07&gt;] kmem_cache_free+0x77/0x350
    [&lt;ffffffff8f453912&gt;] unlink_anon_vmas+0x82/0x1e0
    [&lt;ffffffff8f440341&gt;] free_pgtables+0xa1/0x110
    [&lt;ffffffff8f44af91&gt;] exit_mmap+0xc1/0x170
    [&lt;ffffffff8f29db60&gt;] mmput+0x80/0x150
    [&lt;ffffffff8f2a7609&gt;] do_exit+0x2a9/0xd20

The references in the debug objects may also hide a real memory leak.

As there is no point in having kmemleak to track debug object
allocations, kmemleak checking is now disabled for debug objects.

Signed-off-by: Waiman Long &lt;longman@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/1502718733-8527-1-git-send-email-longman@redhat.com

</content>
</entry>
<entry>
<title>sched/headers: Prepare for new header dependencies before moving code to &lt;linux/sched/task_stack.h&gt;</title>
<updated>2017-03-02T07:42:36Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@kernel.org</email>
</author>
<published>2017-02-08T17:51:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=68db0cf10678630d286f4bbbbdfa102951a35faa'/>
<id>urn:sha1:68db0cf10678630d286f4bbbbdfa102951a35faa</id>
<content type='text'>
We are going to split &lt;linux/sched/task_stack.h&gt; out of &lt;linux/sched.h&gt;, which
will have to be picked up from other headers and a couple of .c files.

Create a trivial placeholder &lt;linux/sched/task_stack.h&gt; file that just
maps to &lt;linux/sched.h&gt; to make this patch obviously correct and
bisectable.

Include the new header in the files that are going to need it.

Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>debugobjects: Improve variable naming</title>
<updated>2017-02-10T08:53:04Z</updated>
<author>
<name>Waiman Long</name>
<email>longman@redhat.com</email>
</author>
<published>2017-02-07T21:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0cad93c3453fc9d11692d3924ac3a520821bbf64'/>
<id>urn:sha1:0cad93c3453fc9d11692d3924ac3a520821bbf64</id>
<content type='text'>
As suggested by Ingo, the debug_objects_alloc counter is now renamed to
debug_objects_allocated with minor twist in comment and debug output.

Signed-off-by: Waiman Long &lt;longman@redhat.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1486503630-1501-1-git-send-email-longman@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>debugobjects: Reduce contention on the global pool_lock</title>
<updated>2017-02-05T16:09:32Z</updated>
<author>
<name>Waiman Long</name>
<email>longman@redhat.com</email>
</author>
<published>2017-01-05T20:17:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=858274b6a13b4db0e6fb451eea7f8817c42426a7'/>
<id>urn:sha1:858274b6a13b4db0e6fb451eea7f8817c42426a7</id>
<content type='text'>
On a large SMP system with many CPUs, the global pool_lock may become
a performance bottleneck as all the CPUs that need to allocate or
free debug objects have to take the lock. That can sometimes cause
soft lockups like:

 NMI watchdog: BUG: soft lockup - CPU#35 stuck for 22s! [rcuos/1:21]
 ...
 RIP: 0010:[&lt;ffffffff817c216b&gt;]  [&lt;ffffffff817c216b&gt;]
	_raw_spin_unlock_irqrestore+0x3b/0x60
 ...
 Call Trace:
  [&lt;ffffffff813f40d1&gt;] free_object+0x81/0xb0
  [&lt;ffffffff813f4f33&gt;] debug_check_no_obj_freed+0x193/0x220
  [&lt;ffffffff81101a59&gt;] ? trace_hardirqs_on_caller+0xf9/0x1c0
  [&lt;ffffffff81284996&gt;] ? file_free_rcu+0x36/0x60
  [&lt;ffffffff81251712&gt;] kmem_cache_free+0xd2/0x380
  [&lt;ffffffff81284960&gt;] ? fput+0x90/0x90
  [&lt;ffffffff81284996&gt;] file_free_rcu+0x36/0x60
  [&lt;ffffffff81124c23&gt;] rcu_nocb_kthread+0x1b3/0x550
  [&lt;ffffffff81124b71&gt;] ? rcu_nocb_kthread+0x101/0x550
  [&lt;ffffffff81124a70&gt;] ? sync_exp_work_done.constprop.63+0x50/0x50
  [&lt;ffffffff810c59d1&gt;] kthread+0x101/0x120
  [&lt;ffffffff81101a59&gt;] ? trace_hardirqs_on_caller+0xf9/0x1c0
  [&lt;ffffffff817c2d32&gt;] ret_from_fork+0x22/0x50

To reduce the amount of contention on the pool_lock, the actual
kmem_cache_free() of the debug objects will be delayed if the pool_lock
is busy. This will temporarily increase the amount of free objects
available at the free pool when the system is busy. As a result,
the number of kmem_cache allocation and freeing is reduced.

To further reduce the lock operations free debug objects in batches of
four.

Signed-off-by: Waiman Long &lt;longman@redhat.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: "Du Changbin" &lt;changbin.du@intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jan Stancek &lt;jstancek@redhat.com&gt;
Link: http://lkml.kernel.org/r/1483647425-4135-4-git-send-email-longman@redhat.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>debugobjects: Scale thresholds with # of CPUs</title>
<updated>2017-02-04T08:01:55Z</updated>
<author>
<name>Waiman Long</name>
<email>longman@redhat.com</email>
</author>
<published>2017-01-05T20:17:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=97dd552eb23c83dbf626a6e84666c7e281375d47'/>
<id>urn:sha1:97dd552eb23c83dbf626a6e84666c7e281375d47</id>
<content type='text'>
On a large SMP systems with hundreds of CPUs, the current thresholds
for allocating and freeing debug objects (256 and 1024 respectively)
may not work well. This can cause a lot of needless calls to
kmem_aloc() and kmem_free() on those systems.

To alleviate this thrashing problem, the object freeing threshold
is now increased to "1024 + # of CPUs * 32". Whereas the object
allocation threshold is increased to "256 + # of CPUs * 4". That
should make the debug objects subsystem scale better with the number
of CPUs available in the system.

Signed-off-by: Waiman Long &lt;longman@redhat.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: "Du Changbin" &lt;changbin.du@intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jan Stancek &lt;jstancek@redhat.com&gt;
Link: http://lkml.kernel.org/r/1483647425-4135-3-git-send-email-longman@redhat.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>debugobjects: Track number of kmem_cache_alloc/kmem_cache_free done</title>
<updated>2017-02-04T08:01:54Z</updated>
<author>
<name>Waiman Long</name>
<email>longman@redhat.com</email>
</author>
<published>2017-01-05T20:17:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c4b73aabd0989d93b82894417ae501690bd1db5e'/>
<id>urn:sha1:c4b73aabd0989d93b82894417ae501690bd1db5e</id>
<content type='text'>
New debugfs stat counters are added to track the numbers of
kmem_cache_alloc() and kmem_cache_free() function calls to get a
sense of how the internal debug objects cache management is performing.

Signed-off-by: Waiman Long &lt;longman@redhat.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: "Du Changbin" &lt;changbin.du@intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jan Stancek &lt;jstancek@redhat.com&gt;
Link: http://lkml.kernel.org/r/1483647425-4135-2-git-send-email-longman@redhat.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq</title>
<updated>2016-12-13T20:59:57Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-12-13T20:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c11a6cfb0103d5d831e20bd9b75d10d13519fec5'/>
<id>urn:sha1:c11a6cfb0103d5d831e20bd9b75d10d13519fec5</id>
<content type='text'>
Pull workqueue updates from Tejun Heo:
 "Mostly patches to initialize workqueue subsystem earlier and get rid
  of keventd_up().

  The patches were headed for the last merge cycle but got delayed due
  to a bug found late minute, which is fixed now.

  Also, to help debugging, destroy_workqueue() is more chatty now on a
  sanity check failure."

* 'for-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: move wq_numa_init() to workqueue_init()
  workqueue: remove keventd_up()
  debugobj, workqueue: remove keventd_up() usage
  slab, workqueue: remove keventd_up() usage
  power, workqueue: remove keventd_up() usage
  tty, workqueue: remove keventd_up() usage
  mce, workqueue: remove keventd_up() usage
  workqueue: make workqueue available early during boot
  workqueue: dump workqueue state on sanity check failures in destroy_workqueue()
</content>
</entry>
<entry>
<title>lib/debugobjects: export for use in modules</title>
<updated>2016-12-01T00:32:52Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2016-11-30T23:54:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f8ff04e2be0815b34d11a72d08473a383a3c9eb5'/>
<id>urn:sha1:f8ff04e2be0815b34d11a72d08473a383a3c9eb5</id>
<content type='text'>
Drivers, or other modules, that use a mixture of objects (especially
objects embedded within other objects) would like to take advantage of
the debugobjects facilities to help catch misuse.  Currently, the
debugobjects interface is only available to builtin drivers and requires
a set of EXPORT_SYMBOL_GPL for use by modules.

I am using the debugobjects in i915.ko to try and catch some invalid
operations on embedded objects.  The problem currently only presents
itself across module unload so forcing i915 to be builtin is not an
option.

Link: http://lkml.kernel.org/r/20161122143039.6433-1-chris@chris-wilson.co.uk
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: "Du, Changbin" &lt;changbin.du@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Christian Borntraeger &lt;borntraeger@de.ibm.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>
</feed>
