Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO)

2019-05-01 Thread Waiman Long
On Wed, Apr 03, 2019 at 11:34:04AM -0600, Khalid Aziz wrote: > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 858b6c0b9a15..9b36da94760e 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++

Re: [PATCH v2 07/17] debugobjects: Move printk out of db lock critical sections

2018-11-22 Thread Waiman Long
On 11/22/2018 11:02 AM, Petr Mladek wrote: > On Thu 2018-11-22 11:04:22, Sergey Senozhatsky wrote: >> On (11/21/18 11:49), Waiman Long wrote: >> [..] >>>>case ODEBUG_STATE_ACTIVE: >>>> - debug_print_object(obj, &quo

Re: [PATCH v2 09/17] debugobjects: Make object hash locks nestable terminal locks

2018-11-22 Thread Waiman Long
On 11/22/2018 10:33 AM, Petr Mladek wrote: > On Mon 2018-11-19 13:55:18, Waiman Long wrote: >> By making the object hash locks nestable terminal locks, we can avoid >> a bunch of unnecessary lockdep validations as well as saving space >> in the lockdep tables. > Please, exp

Re: [PATCH v2 07/17] debugobjects: Move printk out of db lock critical sections

2018-11-22 Thread Waiman Long
On 11/21/2018 09:04 PM, Sergey Senozhatsky wrote: > On (11/21/18 11:49), Waiman Long wrote: > [..] >>> case ODEBUG_STATE_ACTIVE: >>> - debug_print_object(obj, "init"); >>> state = obj->state; >>&

Re: [PATCH v2 07/17] debugobjects: Move printk out of db lock critical sections

2018-11-21 Thread Waiman Long
On 11/19/2018 01:55 PM, Waiman Long wrote: > The db->lock is a raw spinlock and so the lock hold time is supposed > to be short. This will not be the case when printk() is being involved > in some of the critical sections. In order to avoid the long hold time, > in case som

[PATCH v2 11/17] locking/rwsem: Mark rwsem.wait_lock as a terminal lock

2018-11-19 Thread Waiman Long
-by: Waiman Long --- include/linux/rwsem.h | 11 ++- kernel/locking/rwsem-xadd.c | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 67dbb57..a2a2385 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h

[PATCH v2 17/17] locking/lockdep: Check raw/non-raw locking conflicts

2018-11-19 Thread Waiman Long
A task holding a raw spinlock should not acquire a non-raw lock as that will break PREEMPT_RT kernel. Checking is now added and a lockdep warning will be printed if that happens. Signed-off-by: Waiman Long --- include/linux/lockdep.h | 6 ++ include/linux/spinlock_types.h | 4

[PATCH v2 14/17] dma-debug: Mark free_entries_lock as terminal

2018-11-19 Thread Waiman Long
By making free_entries_lock a terminal spinlock, it reduces the lockdep overhead when this lock is used. Signed-off-by: Waiman Long --- kernel/dma/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 231ca46..f891688 100644

[PATCH v2 13/17] mm/kasan: Make quarantine_lock a terminal lock

2018-11-19 Thread Waiman Long
By making quarantine_lock a terminal spinlock, it reduces the lockdep overhead when this lock is being used. Signed-off-by: Waiman Long --- mm/kasan/quarantine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c index b209dba

[PATCH v2 10/17] lib/stackdepot: Make depot_lock a terminal spinlock

2018-11-19 Thread Waiman Long
By defining depot_lock as a terminal spinlock, it reduces the lockdep overhead when this lock is being used. Signed-off-by: Waiman Long --- lib/stackdepot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index e513459..fb17888 100644

[PATCH v2 16/17] delay_acct: Mark task's delays->lock as terminal spinlock

2018-11-19 Thread Waiman Long
By making task's delays->lock a terminal spinlock, it reduces the lockdep overhead when this lock is used. Signed-off-by: Waiman Long --- kernel/delayacct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/delayacct.c b/kernel/delayacct.c index 2a12b98..49dd

[PATCH v2 09/17] debugobjects: Make object hash locks nestable terminal locks

2018-11-19 Thread Waiman Long
By making the object hash locks nestable terminal locks, we can avoid a bunch of unnecessary lockdep validations as well as saving space in the lockdep tables. Signed-off-by: Waiman Long --- lib/debugobjects.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib

[PATCH v2 08/17] locking/lockdep: Add support for nestable terminal locks

2018-11-19 Thread Waiman Long
-by: Waiman Long --- include/linux/lockdep.h| 9 - kernel/locking/lockdep.c | 15 +-- kernel/locking/lockdep_internals.h | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index a146bca

[PATCH v2 15/17] kernfs: Mark kernfs_open_node_lock as terminal lock

2018-11-19 Thread Waiman Long
By making kernfs_open_node_lock a terminal spinlock, it reduces the lockdep overhead when this lock is used. Signed-off-by: Waiman Long --- fs/kernfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index dbf5bc2..a86fe22 100644

[PATCH v2 12/17] cgroup: Mark the rstat percpu lock as terminal

2018-11-19 Thread Waiman Long
By classifying the cgroup rstat percpu locks as terminal locks, it reduces the lockdep overhead when these locks are being used. Signed-off-by: Waiman Long --- kernel/cgroup/rstat.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/rstat.c b/kernel

[PATCH v2 07/17] debugobjects: Move printk out of db lock critical sections

2018-11-19 Thread Waiman Long
ack() and debug_print_object() calls are now moved out of those critical sections. Signed-off-by: Waiman Long --- lib/debugobjects.c | 61 +- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 403d

[PATCH v2 04/17] locking/lockdep: Add DEFINE_TERMINAL_SPINLOCK() and related macros

2018-11-19 Thread Waiman Long
Add new DEFINE_RAW_TERMINAL_SPINLOCK() and DEFINE_TERMINAL_SPINLOCK() macro to define a raw terminal spinlock and a terminal spinlock. Signed-off-by: Waiman Long --- include/linux/spinlock_types.h | 34 +++--- kernel/printk/printk_safe.c| 2 +- 2 files changed

[PATCH v2 06/17] debugobjects: Mark pool_lock as a terminal lock

2018-11-19 Thread Waiman Long
By marking the internal pool_lock as a terminal lock, lockdep will be able to skip full validation to improve locking performance. Signed-off-by: Waiman Long --- lib/debugobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index

[PATCH v2 02/17] locking/lockdep: Rework lockdep_set_novalidate_class()

2018-11-19 Thread Waiman Long
sed at all unless there is overwhelming reason to do so. Hopefully we can retired it in the near future. Signed-off-by: Waiman Long --- include/linux/lockdep.h | 17 ++--- kernel/locking/lockdep.c | 14 +++--- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git

[PATCH v2 03/17] locking/lockdep: Add a new terminal lock type

2018-11-19 Thread Waiman Long
flags field. The pin_count field is essentially a summation of 16-bit random cookie values. Removing 4 bits still allow the pin_count to accumulate up to almost 4096 of those cookie values. Signed-off-by: Waiman Long --- include/linux/lockdep.h| 29 --- kernel

[PATCH v2 01/17] locking/lockdep: Remove version from lock_class structure

2018-11-19 Thread Waiman Long
It turns out the version field in the lock_class structure isn't used anywhere. Just remove it. Signed-off-by: Waiman Long --- include/linux/lockdep.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 1fd82ff..c5335df 100644

[PATCH v2 05/17] printk: Mark logbuf_lock & console_owner_lock as terminal locks

2018-11-19 Thread Waiman Long
By marking logbuf_lock and console_owner_lock as terminal locks, it reduces the performance overhead when those locks are used with lockdep enabled. Signed-off-by: Waiman Long --- kernel/printk/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/printk

[PATCH v2 00/17] locking/lockdep: Add a new class of terminal locks

2018-11-19 Thread Waiman Long
bit architectures with CONFIG_LOCK_STAT defined. The lockdep_map structure will increase in size for 32-bit architectures or when CONFIG_LOCK_STAT isn't defined. Waiman Long (17): locking/lockdep: Remove version from lock_class structure locking/lockdep: Rework lockdep_set_novalidate_class() lock