debugobjects: Reduce number of pool_lock acquisitions in fill_pool()
authorWaiman Long <longman@redhat.com>
Mon, 20 May 2019 14:14:48 +0000 (10:14 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 14 Jun 2019 12:51:15 +0000 (14:51 +0200)
commitd26bf5056fc087d845bfbb8b651b4be2933ab7a6
tree6a07feea9b2a5f39b0376a32de2dce01424f7b16
parent634d61f45d6f668fe7e468b62d00ae469a583ca2
debugobjects: Reduce number of pool_lock acquisitions in fill_pool()

In fill_pool(), the pool_lock is acquired and then released once per debug
object. If many objects are to be filled, the constant lock and unlock
operations are extra overhead.

To reduce the overhead, batch them up and do an allocation of 4 objects per
lock/unlock sequence.

Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Yang Shi <yang.shi@linux.alibaba.com>
Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Cc: Qian Cai <cai@gmx.us>
Cc: Zhong Jiang <zhongjiang@huawei.com>
Link: https://lkml.kernel.org/r/20190520141450.7575-4-longman@redhat.com
lib/debugobjects.c