Re: [PATCH v3 16/24] locking/lockdep: Retain the class key and name while freeing a lock class

2018-12-07 Thread Bart Van Assche
On Fri, 2018-12-07 at 09:50 -0500, Waiman Long wrote: > On 12/07/2018 05:21 AM, Peter Zijlstra wrote: > > On Thu, Dec 06, 2018 at 05:11:40PM -0800, Bart Van Assche wrote: > > > The next patch in this series uses the class name in code that > > > detects calls to lock_acq

Re: [PATCH v3 17/24] locking/lockdep: Free lock classes that are no longer in use

2018-12-07 Thread Bart Van Assche
On Fri, 2018-12-07 at 13:14 +0100, Peter Zijlstra wrote: > On Thu, Dec 06, 2018 at 05:11:41PM -0800, Bart Van Assche wrote: > > + if (WARN_ON_ONCE(!hlock_class(prev)->hash_entry.pprev) || > > + WARN_ONCE(!hlock_class(next)->hash_entry.pprev, > > +

Re: [PATCH v3 00/24] locking/lockdep: Add support for dynamic keys

2018-12-07 Thread Bart Van Assche
On Fri, 2018-12-07 at 13:23 +0100, Peter Zijlstra wrote: > I took the first 15 patches for now to shrink the series. Thanks Peter. Since I would like to rebase the remaining patches on top of what you have already queued: is what you have queued available in a public git repository? I had a quick

Re: [PATCH 22/27] locking/lockdep: Reuse list entries that are no longer in use

2018-12-03 Thread Bart Van Assche
On Sat, 2018-12-01 at 21:24 +0100, Peter Zijlstra wrote: > On Thu, Nov 29, 2018 at 08:48:50AM -0800, Bart Van Assche wrote: > > On Thu, 2018-11-29 at 13:01 +0100, Peter Zijlstra wrote: > > > On Thu, Nov 29, 2018 at 11:49:02AM +0100, Peter Zijlstra wrote: > > > > On W

Re: [PATCH 25/27] locking/lockdep: Add support for dynamic keys

2018-12-03 Thread Bart Van Assche
On Thu, 2018-11-29 at 11:10 +0100, Peter Zijlstra wrote: > On Wed, Nov 28, 2018 at 03:43:23PM -0800, Bart Van Assche wrote: > > +/* hash_entry is used to keep track of dynamically allocated keys. */ > > struct lock_class_key { > > + struct hlist_node hash_

Re: [PATCH 22/27] locking/lockdep: Reuse list entries that are no longer in use

2018-12-03 Thread Bart Van Assche
On Mon, 2018-12-03 at 18:32 +0100, Peter Zijlstra wrote: > On Mon, Dec 03, 2018 at 08:40:48AM -0800, Bart Van Assche wrote: > > > > I think we can do this with a free bitmap and an array of 2 pending > > > bitmaps and an index. Add newly freed entries to the pending bitma

[PATCH v2 04/24] lockdep tests: Run lockdep tests a second time under Valgrind

2018-12-03 Thread Bart Van Assche
This improves test coverage. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/run_tests.sh | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh index

[PATCH v2 00/24] locking/lockdep: Add support for dynamic keys

2018-12-03 Thread Bart Van Assche
f no name has been assigned to a lock object. That patch namely causes the build bot to complain about certain lock objects but I have not yet had the time to figure out the identity of these lock objects. Bart. Bart Van Assche (24): lockdep tests: Display compiler warning and error

[PATCH v2 14/24] locking/lockdep: Make zap_class() remove all matching lock order entries

2018-12-03 Thread Bart Van Assche
Make sure that all lock order entries that refer to a class are removed from the list_entries[] array when a kernel module is unloaded. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 1 + kernel/locking/lockdep.c | 17

[PATCH v2 08/24] locking/lockdep: Declare local symbols static

2018-12-03 Thread Bart Van Assche
This patch avoids that sparse complains about a missing declaration for the lock_classes array. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/locking/lockdep.c b

[PATCH v2 12/24] locking/lockdep: Make concurrent lockdep_reset_lock() calls safe

2018-12-03 Thread Bart Van Assche
Since zap_class() removes items from the all_lock_classes list and the classhash_table, protect all zap_class() calls with the graph lock. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 02/24] lockdep tests: Fix shellcheck warnings

2018-12-03 Thread Bart Van Assche
Use find instead of ls to avoid splitting filenames that contain spaces. Use rm -f instead of if ... then rm ...; fi. This patch addresses all shellcheck complaints about the run_tests.sh shell script. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche

[PATCH v2 05/24] liblockdep: Rename "trywlock" into "trywrlock"

2018-12-03 Thread Bart Van Assche
hread_rwlock_t implementation") Cc: Sasha Levin Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/include/liblockdep/rwlock.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lib/lockdep/include/l

[PATCH v2 23/24] kernel/workqueue: Use dynamic lockdep keys for workqueues

2018-12-03 Thread Bart Van Assche
df/0xbb0 generic_file_direct_write+0x119/0x220 __generic_file_write_iter+0x131/0x2d0 ext4_file_write_iter+0x3fa/0x710 aio_write+0x235/0x330 io_submit_one+0x510/0xeb0 __x64_sys_io_submit+0x122/0x340 do_syscall_64+0x71/0x220 entry_SYSCALL_64_after_hwframe+0x49/0xbe Cc: Ingo Molna

[PATCH v2 21/24] locking/lockdep: Verify whether lock objects are small enough to be used as class keys

2018-12-03 Thread Bart Van Assche
Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 9 + 1 file changed, 9 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index c936fce5b9d7..b4772e5fc176 100644 --- a/kernel/locking

[PATCH v2 24/24] lockdep tests: Test dynamic key registration

2018-12-03 Thread Bart Van Assche
Make sure that the lockdep_register_key() and lockdep_unregister_key() code is tested when running the lockdep tests. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/include/liblockdep/common.h | 2 ++ tools/lib/lockdep/include

[PATCH v2 20/24] locking/lockdep: Introduce __lockdep_free_key_range()

2018-12-03 Thread Bart Van Assche
This patch does not change any functionality but makes the next patch in this series easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 27 +-- 1 file changed, 17 insertions(+), 10

[PATCH v2 22/24] locking/lockdep: Add support for dynamic keys

2018-12-03 Thread Bart Van Assche
encountering a dynamically allocated key. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 13 - kernel/locking/lockdep.c | 120 --- 2 files changed, 122 insertions(+), 11 deletions

[PATCH v2 19/24] locking/lockdep: Check data structure consistency

2018-12-03 Thread Bart Van Assche
Debugging lockdep data structure inconsistencies is challenging. Add disabled code that verifies data structure consistency at runtime. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 147

[PATCH v2 18/24] locking/lockdep: Reuse list entries that are no longer in use

2018-12-03 Thread Bart Van Assche
Instead of abandoning elements of list_entries[] that are no longer in use, make alloc_list_entry() reuse array elements that have been freed. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 27 --- 1

[PATCH v2 17/24] locking/lockdep: Free lock classes that are no longer in use

2018-12-03 Thread Bart Van Assche
Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 9 +- kernel/locking/lockdep.c | 237 --- 2 files changed, 205 insertions(+), 41 deletions(-) diff --git a/include/linux/lockdep.h b/include/linux/lockd

[PATCH v2 16/24] locking/lockdep: Retain the class key and name while freeing a lock class

2018-12-03 Thread Bart Van Assche
The next patch in this series uses the class name in code that detects lock class use-after-free. Hence retain the class name for lock classes that are being freed. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 4 +--- 1

[PATCH v2 15/24] locking/lockdep: Reorder struct lock_class members

2018-12-03 Thread Bart Van Assche
This patch does not change any functionality but makes the patch that frees lock classes that are no longer in use easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 14 +++--- 1 file changed, 7 insertions

[PATCH v2 13/24] locking/lockdep: Stop using RCU primitives to access all_lock_classes

2018-12-03 Thread Bart Van Assche
Due to the previous patch all code that accesses the 'all_lock_classes' list holds the graph lock. Hence use regular list primitives instead of their RCU variants to access this list. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kern

[PATCH v2 10/24] locking/lockdep: Introduce lock_class_cache_is_registered()

2018-12-03 Thread Bart Van Assche
This patch does not change any functionality but makes the lockdep_reset_lock() function easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 50 1 file changed, 30

[PATCH v2 09/24] locking/lockdep: Inline __lockdep_init_map()

2018-12-03 Thread Bart Van Assche
Since the function __lockdep_init_map() only has one caller, inline it into its caller. This patch does not change any functionality. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 8 +--- 1 file changed, 1 insertion

[PATCH v2 07/24] lockdep tests: Test the lockdep_reset_lock() implementation

2018-12-03 Thread Bart Van Assche
This patch makes sure that the lockdep_reset_lock() function gets tested. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/include/liblockdep/common.h | 1 + tools/lib/lockdep/include/liblockdep/mutex.h | 1 + tools/lib/lockdep/tests

[PATCH v2 01/24] lockdep tests: Display compiler warning and error messages

2018-12-03 Thread Bart Van Assche
If compilation of liblockdep fails, display an error message and exit immediately. Display compiler warning and error messages that are generated while building a test. Only run a test if compilation succeeded. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche

[PATCH v2 06/24] liblockdep: Add dummy print_irqtrace_events() implementation

2018-12-03 Thread Bart Van Assche
This patch avoids that linking against liblockdep fails due to no print_irqtrace_events() definition being available. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/lockdep.c | 5 + 1 file changed, 5 insertions(+) diff --git a

[PATCH v2 11/24] locking/lockdep: Remove a superfluous INIT_LIST_HEAD() statement

2018-12-03 Thread Bart Van Assche
Initializing a list entry just before it is passed to list_add_tail_rcu() is not necessary because list_add_tail_rcu() overwrites the next and prev pointers anyway. Hence remove the INIT_LIST_HEAD() statement. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche

[PATCH v2 03/24] lockdep tests: Improve testing accuracy

2018-12-03 Thread Bart Van Assche
Instead of checking whether the tests produced any output, check the output itself. This patch avoids that e.g. debug output causes the message "PASSED!" to be reported for failed tests. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/l

[PATCH 2/2] kernel/workqueue: Use dynamic lockdep keys for workqueues

2018-11-09 Thread Bart Van Assche
df/0xbb0 generic_file_direct_write+0x119/0x220 __generic_file_write_iter+0x131/0x2d0 ext4_file_write_iter+0x3fa/0x710 aio_write+0x235/0x330 io_submit_one+0x510/0xeb0 __x64_sys_io_submit+0x122/0x340 do_syscall_64+0x71/0x220 entry_SYSCALL_64_after_hwframe+0x49/0xbe Cc: Peter Zijlstra Cc: Ingo

[PATCH 1/2] locking/lockdep: Add support for dynamic depmaps and keys

2018-11-09 Thread Bart Van Assche
. Hence add support for allocating instances of these objects dynamically. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: Tejun Heo Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 2 ++ kernel/locking/lockdep.c | 16 +--- 2 files changed, 15

[PATCH 0/2] locking/lockdep: Support dynamic lockdep keys

2018-11-09 Thread Bart Van Assche
m not sure whether the approach of patch 1/2 is correct. Thanks, Bart. Bart Van Assche (2): locking/lockdep: Add support for dynamic depmaps and keys kernel/workqueue: Use dynamic lockdep keys for workqueues include/linux/lockdep.h | 2 ++ include/linux/workqueue.h | 28 -

Re: [PATCH] ib_srpt: use kvmalloc to allocate ring pointers

2018-07-09 Thread Bart Van Assche
On Mon, 2018-07-09 at 16:51 +0300, Jan Dakinevich wrote: > An array of pointers to SRPT contexts in ib_device is over 30KiB even > in default case, in which an amount of contexts is 4095. The patch > is intended to weed out large contigous allocation for non-DMA memory. Reviewed-by:

Re: [PATCH] ib_srpt: use kvmalloc to allocate ring pointers

2018-07-10 Thread Bart Van Assche
On Tue, 2018-07-10 at 08:39 +0300, Leon Romanovsky wrote: > On Mon, Jul 09, 2018 at 04:51:08PM +0300, Jan Dakinevich wrote: > > An array of pointers to SRPT contexts in ib_device is over 30KiB even > > in default case, in which an amount of contexts is 4095. The patch > > is intended to weed out la

Re: Tracing to console

2018-06-26 Thread Bart Van Assche
Hello Steven and Ingo, Did I report this observation to the right people? Thank you, Bart. On 06/15/18 14:01, Bart Van Assche wrote: Hello Steven, If I run the following commands as root: cd /sys/kernel/debug/tracing grep pm_ available_events > set_event echo function >current_trace

Re: [PATCH 1/5] blk-mq: add API to get hctx index from request

2018-06-28 Thread Bart Van Assche
On 06/28/18 14:03, Keith Busch wrote: Signed-off-by: Keith Busch --- block/blk-mq.c | 6 ++ include/linux/blk-mq.h | 1 + 2 files changed, 7 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index b429d515b568..c6478833464d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq

Re: [PATCH 0/7] psi: pressure stall information for CPU, memory, and IO

2018-05-14 Thread Bart Van Assche
On 05/14/18 08:39, Christopher Lameter wrote: On Mon, 7 May 2018, Johannes Weiner wrote: What to make of this number? If CPU utilization is at 100% and CPU pressure is 0, it means the system is perfectly utilized, with one runnable thread per CPU and nobody waiting. At two or more runnable tasks

[PATCH v9 0/2] blk-mq: Rework blk-mq timeout handling again

2018-05-14 Thread Bart Van Assche
ct request and used the __deadline member to encode both the generation and state information. Bart Van Assche (2): arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64 blk-mq: Rework blk-mq timeout handling again .../features/locking/cmpxchg64/arch-support.txt| 31 ar

[PATCH v9 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-14 Thread Bart Van Assche
to two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Sebastian Ott Cc: Sagi Grimberg Cc: Israel Rukshin , Cc: Max Gurtovoy --- block/blk-core.c | 6 -- block/

[PATCH v9 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-14 Thread Bart Van Assche
The next patch in this series introduces a call to cmpxchg64() in the block layer core for those architectures on which this functionality is available. Make it possible to test whether cmpxchg64() is available by introducing CONFIG_ARCH_HAVE_CMPXCHG64. Signed-off-by: Bart Van Assche Cc: Catalin

Re: [PATCH v9 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-14 Thread Bart Van Assche
On Mon, 2018-05-14 at 11:50 -0700, Max Filippov wrote: > On Mon, May 14, 2018 at 11:46 AM, Bart Van Assche > wrote: > > The next patch in this series introduces a call to cmpxchg64() > > in the block layer core for those architectures on which this > > functionality is ava

[PATCH] kernel.h: Avoid that sparse complains about using sizeof(void)

2018-07-05 Thread Bart Van Assche
The macro __is_constexpr() causes sparse to report the following: warning: expression using sizeof(void) Avoid this by using __builtin_constant_p() instead. Fixes: 3c8ba0d61d04 ("kernel.h: Retain constant expression output for max()/min()") Signed-off-by: Bart Van Assche

Tracing to console

2018-06-15 Thread Bart Van Assche
Hello Steven, If I run the following commands as root: cd /sys/kernel/debug/tracing grep pm_ available_events > set_event echo function >current_tracer grep scsi_ available_filter_functions | while read a b; do echo $a; done >set_ftrace_filter echo 1 >events/printk/enable echo 1 >tracing_on echo

[PATCH] configfs: Use kvasprintf() instead of open-coding it

2018-06-15 Thread Bart Van Assche
Signed-off-by: Bart Van Assche --- fs/configfs/item.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/fs/configfs/item.c b/fs/configfs/item.c index 88f266efc09b..99d491cd01f9 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -64,7 +64,6

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-17 Thread Bart Van Assche
On Tue, 2018-05-08 at 21:33 -0400, Kent Overstreet wrote: > [ ... ] Hello Kent, With Jens' latest for-next branch I hit the kernel warning shown below. Can you have a look? Thanks, Bart. == BUG: KASAN: use-after-free in bio_advan

Re: [PATCH 00/10] Misc block layer patches for bcachefs

2018-05-18 Thread Bart Van Assche
On Fri, 2018-05-18 at 05:06 -0400, Kent Overstreet wrote: > On Thu, May 17, 2018 at 08:54:57PM +0000, Bart Van Assche wrote: > > With Jens' latest for-next branch I hit the kernel warning shown below. Can > > you have a look? > > Any hints on how to reproduce it? Sure.

[PATCH v11 2/2] blk-mq: Rework blk-mq timeout handling again

2018-05-18 Thread Bart Van Assche
ion. - Atomic instructions are only used to update the request state if a concurrent request state change could be in progress. - blk_add_timer() has been split into two functions - one for the legacy block layer and one for blk-mq. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig

[PATCH v11 1/2] arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64

2018-05-18 Thread Bart Van Assche
The next patch in this series introduces a call to cmpxchg64() in the block layer core for those architectures on which this functionality is available. Make it possible to test whether cmpxchg64() is available by introducing CONFIG_ARCH_HAVE_CMPXCHG64. Signed-off-by: Bart Van Assche Cc: Catalin

[PATCH v11 0/2] blk-mq: Rework blk-mq timeout handling again

2018-05-18 Thread Bart Van Assche
state members of struct request and used the __deadline member to encode both the generation and state information. Bart Van Assche (2): arch/*: Add CONFIG_ARCH_HAVE_CMPXCHG64 blk-mq: Rework blk-mq timeout handling again .../features/locking/cmpxchg64/arc

Re: linux-next: Signed-off-by missing for commits in the bpf-next tree

2018-12-12 Thread Bart Van Assche
On Wed, 2018-12-12 at 15:39 -0800, Alexei Starovoitov wrote: > On Thu, Dec 13, 2018 at 09:48:20AM +1100, Stephen Rothwell wrote: > > Hi Alexei, > > > > On Wed, 12 Dec 2018 12:53:11 -0800 Alexei Starovoitov > > wrote: > > > > > > On Thu, Dec 13, 2018 at 07:32:45AM +1100, Stephen Rothwell wrote:

Re: [PATCH] blkcg: handle dying request_queue when associating a blkg

2018-12-12 Thread Bart Van Assche
On Tue, 2018-12-11 at 23:06 -0500, Dennis Zhou wrote: > Hi Bart, > > On Tue, Dec 11, 2018 at 03:16:13PM -0800, Bart Van Assche wrote: > > On Tue, 2018-12-11 at 18:03 -0500, Dennis Zhou wrote: > > > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c > > > index

[PATCH v5 00/15] locking/lockdep: Add support for dynamic keys

2018-12-17 Thread Bart Van Assche
causes lockdep to complain if no name has been assigned to a lock object. That patch namely causes the build bot to complain about certain lock objects but I have not yet had the time to figure out the identity of these lock objects. Bart. Bart Van Assche (15): locking/lockdep: Fix required me

[PATCH v5 02/15] locking/lockdep: Make zap_class() remove all matching lock order entries

2018-12-17 Thread Bart Van Assche
Make sure that all lock order entries that refer to a class are removed from the list_entries[] array when a kernel module is unloaded. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 1 + kernel/locking/lockdep.c | 19

[PATCH v5 03/15] locking/lockdep: Reorder struct lock_class members

2018-12-17 Thread Bart Van Assche
This patch does not change any functionality but makes the patch that frees lock classes that are no longer in use easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 14 +++--- 1 file changed, 7 insertions

[PATCH v5 12/15] locking/lockdep: Verify whether lock objects are small enough to be used as class keys

2018-12-17 Thread Bart Van Assche
Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index d411660572e1..1eb03a29f2c2 100644 --- a/kernel/locking

[PATCH v5 14/15] kernel/workqueue: Use dynamic lockdep keys for workqueues

2018-12-17 Thread Bart Van Assche
df/0xbb0 generic_file_direct_write+0x119/0x220 __generic_file_write_iter+0x131/0x2d0 ext4_file_write_iter+0x3fa/0x710 aio_write+0x235/0x330 io_submit_one+0x510/0xeb0 __x64_sys_io_submit+0x122/0x340 do_syscall_64+0x71/0x220 entry_SYSCALL_64_after_hwframe+0x49/0xbe Cc: Ingo Molna

[PATCH v5 04/15] locking/lockdep: Initialize the locks_before and locks_after lists earlier

2018-12-17 Thread Bart Van Assche
: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 7ca9ac392dde..9ab782378b3b 100644 --- a/kernel

[PATCH v5 13/15] locking/lockdep: Add support for dynamic keys

2018-12-17 Thread Bart Van Assche
encountering a dynamically allocated key. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 13 +++- kernel/locking/lockdep.c | 125 --- 2 files changed, 127 insertions(+), 11 deletions

[PATCH v5 08/15] locking/lockdep: Reuse list entries that are no longer in use

2018-12-17 Thread Bart Van Assche
Instead of abandoning elements of list_entries[] that are no longer in use, make alloc_list_entry() reuse array elements that have been freed. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 33

[PATCH v5 05/15] locking/lockdep: Split lockdep_free_key_range() and lockdep_reset_lock()

2018-12-17 Thread Bart Van Assche
This patch does not change the behavior of these functions but makes the patch that frees unused lock classes easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 74 +--- 1 file

[PATCH v5 10/15] locking/lockdep: Reuse lock chains that have been freed

2018-12-17 Thread Bart Van Assche
A previous patch introduced a lock chain leak. Fix that leak by reusing lock chains that have been freed. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 61 ++-- 1 file changed, 33

[PATCH v5 11/15] locking/lockdep: Check data structure consistency

2018-12-17 Thread Bart Van Assche
Debugging lockdep data structure inconsistencies is challenging. Add disabled code that verifies data structure consistency at runtime. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 183

[PATCH v5 06/15] locking/lockdep: Make it easy to detect whether or not inside a selftest

2018-12-17 Thread Bart Van Assche
context of a lockdep selftest. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 5 + kernel/locking/lockdep.c | 6 ++ lib/locking-selftest.c | 2 ++ 3 files changed, 13 insertions(+) diff --git a/include/linux/lockdep.h b

[PATCH v5 15/15] lockdep tests: Test dynamic key registration

2018-12-17 Thread Bart Van Assche
Make sure that the lockdep_register_key() and lockdep_unregister_key() code is tested when running the lockdep tests. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/include/liblockdep/common.h | 2 ++ tools/lib/lockdep/include

[PATCH v5 01/15] locking/lockdep: Fix required memory size reported if CONFIG_PROVE_LOCKING=n

2018-12-17 Thread Bart Van Assche
Lock chains are only tracked with CONFIG_PROVE_LOCKING=y. Do not report the memory required for the lock chain array if CONFIG_PROVE_LOCKING=n. Fixes: ca58abcb4a6d ("lockdep: sanitise CONFIG_PROVE_LOCKING") # v2.6.23 Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by

[PATCH v5 09/15] locking/lockdep: Introduce lockdep_next_lockchain() and lock_chain_count()

2018-12-17 Thread Bart Van Assche
This patch does not change any functionality but makes the next patch in this series easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 16 +++- kernel/locking/lockdep_internals.h | 3

[PATCH v5 07/15] locking/lockdep: Free lock classes that are no longer in use

2018-12-17 Thread Bart Van Assche
Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 9 +- kernel/locking/lockdep.c | 434 +-- 2 files changed, 381 insertions(+), 62 deletions(-) diff --git a/include/linux/lockdep.h b/inc

[PATCH] lib/rhashtable: Fix work initialization in rhashtable_init()

2018-12-17 Thread Bart Van Assche
@vger.kernel.org Signed-off-by: Bart Van Assche --- lib/rhashtable.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 30526afa8343..6c22534c48e4 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -19,6 +19,7 @@ #include #include #include

Re: [PATCH v4 13/15] locking/lockdep: Add support for dynamic keys

2018-12-14 Thread Bart Van Assche
On Tue, 2018-12-11 at 14:13 -0800, Bart Van Assche wrote: > +/* > + * Unregister a dynamically allocated key. Must not be called from interrupt > + * context. The caller must ensure that freeing @key only happens after an > RCU > + * grace period. > + */ > +void lockdep_

Re: [LKP] [locking/lockdep] 15693f040b: WARNING:at_kernel/locking/lockdep.c:#lockdep_free_key_range

2018-12-17 Thread Bart Van Assche
On Mon, 2018-12-17 at 16:41 +0800, kernel test robot wrote: > FYI, we noticed the following commit (built with gcc-4.9): > > commit: 15693f040b149598cc048c2697b258d3901c ("locking/lockdep: Free lock > classes that are no longer in use") > https://github.com/bvanassche/linux for-next > > in t

Re: cdbeb78c7a ("kernel/workqueue: Use dynamic lockdep keys for .."): WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:1002 lockdep_register_key

2018-12-17 Thread Bart Van Assche
On Mon, 2018-12-17 at 12:16 +0800, kernel test robot wrote: > Greetings, > > 0day kernel testing robot got the below dmesg and the first bad commit is > > https://github.com/bvanassche/linux for-next > > commit cdbeb78c7a2e34af6d6cc5d3570a585a23eea8e9 > Author: Bart

Re: [PATCH] scsi: qla2xxx: fix unused function warning

2018-12-10 Thread Bart Van Assche
On Mon, 2018-12-10 at 21:51 +0100, Arnd Bergmann wrote: > In what seems to be a mismatch between the scsi-fixes branch and > the scsi-mkp/for-next branch, a newly introduced variable from > one patch got obsoleted in another one: > > drivers/scsi/qla2xxx/qla_os.c: In function '__qla2x00_abort_all_

Re: [PATCH v3 05/24] liblockdep: Rename "trywlock" into "trywrlock"

2018-12-11 Thread Bart Van Assche
On Tue, 2018-12-11 at 12:19 -0500, Sasha Levin wrote: > On Thu, Dec 06, 2018 at 05:11:29PM -0800, Bart Van Assche wrote: > > This patch avoids that the following compiler warning is reported while > > compiling the lockdep unit tests: > > > > include/liblo

[PATCH v4 15/15] lockdep tests: Test dynamic key registration

2018-12-11 Thread Bart Van Assche
Make sure that the lockdep_register_key() and lockdep_unregister_key() code is tested when running the lockdep tests. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- tools/lib/lockdep/include/liblockdep/common.h | 2 ++ tools/lib/lockdep/include

[PATCH v4 14/15] kernel/workqueue: Use dynamic lockdep keys for workqueues

2018-12-11 Thread Bart Van Assche
df/0xbb0 generic_file_direct_write+0x119/0x220 __generic_file_write_iter+0x131/0x2d0 ext4_file_write_iter+0x3fa/0x710 aio_write+0x235/0x330 io_submit_one+0x510/0xeb0 __x64_sys_io_submit+0x122/0x340 do_syscall_64+0x71/0x220 entry_SYSCALL_64_after_hwframe+0x49/0xbe Cc: Ingo Molna

[PATCH v4 07/15] locking/lockdep: Free lock classes that are no longer in use

2018-12-11 Thread Bart Van Assche
Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 9 +- kernel/locking/lockdep.c | 434 +-- 2 files changed, 381 insertions(+), 62 deletions(-) diff --git a/include/linux/lockdep.h b/inc

[PATCH v4 01/15] locking/lockdep: Fix required memory size reported if CONFIG_PROVE_LOCKING=n

2018-12-11 Thread Bart Van Assche
Lock chains are only tracked with CONFIG_PROVE_LOCKING=y. Do not report the memory required for the lock chain array if CONFIG_PROVE_LOCKING=n. Fixes: ca58abcb4a6d ("lockdep: sanitise CONFIG_PROVE_LOCKING") # v2.6.23 Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by

[PATCH v4 03/15] locking/lockdep: Reorder struct lock_class members

2018-12-11 Thread Bart Van Assche
This patch does not change any functionality but makes the patch that frees lock classes that are no longer in use easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 14 +++--- 1 file changed, 7 insertions

[PATCH v4 04/15] locking/lockdep: Initialize the locks_before and locks_after lists earlier

2018-12-11 Thread Bart Van Assche
: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 7ca9ac392dde..9ab782378b3b 100644 --- a/kernel

[PATCH v4 10/15] locking/lockdep: Reuse lock chains that have been freed

2018-12-11 Thread Bart Van Assche
A previous patch introduced a lock chain leak. Fix that leak by reusing lock chains that have been freed. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 48 +++- 1 file changed, 33

[PATCH v4 06/15] locking/lockdep: Make it easy to detect whether or not inside a selftest

2018-12-11 Thread Bart Van Assche
context of a lockdep selftest. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 2 ++ kernel/locking/lockdep.c | 1 + lib/locking-selftest.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/include/linux/lockdep.h b/include

[PATCH v4 09/15] locking/lockdep: Introduce lockdep_next_lockchain() and lock_chain_count()

2018-12-11 Thread Bart Van Assche
This patch does not change any functionality but makes the next patch in this series easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 16 +++- kernel/locking/lockdep_internals.h | 3

[PATCH v4 02/15] locking/lockdep: Make zap_class() remove all matching lock order entries

2018-12-11 Thread Bart Van Assche
Make sure that all lock order entries that refer to a class are removed from the list_entries[] array when a kernel module is unloaded. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 1 + kernel/locking/lockdep.c | 19

[PATCH v4 00/15] locking/lockdep: Add support for dynamic keys

2018-12-11 Thread Bart Van Assche
assigned to a lock object. That patch namely causes the build bot to complain about certain lock objects but I have not yet had the time to figure out the identity of these lock objects. Bart. Bart Van Assche (15): locking/lockdep: Fix required memory size reported if CONFIG_PROVE_LOCKING=n

[PATCH v4 11/15] locking/lockdep: Check data structure consistency

2018-12-11 Thread Bart Van Assche
Debugging lockdep data structure inconsistencies is challenging. Add disabled code that verifies data structure consistency at runtime. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 183

[PATCH v4 05/15] locking/lockdep: Split lockdep_free_key_range() and lockdep_reset_lock()

2018-12-11 Thread Bart Van Assche
This patch does not change the behavior of these functions but makes the patch that frees unused lock classes easier to read. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 74 +--- 1 file

[PATCH v4 13/15] locking/lockdep: Add support for dynamic keys

2018-12-11 Thread Bart Van Assche
encountering a dynamically allocated key. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- include/linux/lockdep.h | 13 +++-- kernel/locking/lockdep.c | 114 --- 2 files changed, 116 insertions(+), 11 deletions

[PATCH v4 08/15] locking/lockdep: Reuse list entries that are no longer in use

2018-12-11 Thread Bart Van Assche
Instead of abandoning elements of list_entries[] that are no longer in use, make alloc_list_entry() reuse array elements that have been freed. Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 33

[PATCH v4 12/15] locking/lockdep: Verify whether lock objects are small enough to be used as class keys

2018-12-11 Thread Bart Van Assche
Cc: Peter Zijlstra Cc: Waiman Long Cc: Johannes Berg Signed-off-by: Bart Van Assche --- kernel/locking/lockdep.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index f95c1beddc28..2685b2265f6e 100644 --- a/kernel/locking

Re: [PATCH] blkcg: handle dying request_queue when associating a blkg

2018-12-11 Thread Bart Van Assche
On Tue, 2018-12-11 at 18:03 -0500, Dennis Zhou wrote: > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c > index 6bd0619a7d6e..c30661ddc873 100644 > --- a/block/blk-cgroup.c > +++ b/block/blk-cgroup.c > @@ -202,6 +202,12 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, > WARN_O

Re: [PATCH] lib/rhashtable: Fix work initialization in rhashtable_init()

2018-12-20 Thread Bart Van Assche
On Tue, 2018-12-18 at 21:32 -0800, David Miller wrote: > From: Bart Van Assche > Date: Mon, 17 Dec 2018 13:40:58 -0800 > > > The test_insert_dup() function from lib/test_rhashtable.c passes a > > pointer to a stack object to rhltable_init(). Avoid that the following > &

Re: [PATCH] scsi: sd: Make protection lookup tables static

2019-01-07 Thread Bart Van Assche
On Mon, 2019-01-07 at 22:41 +0800, John Garry wrote: > Currently the protection lookup tables in sd_prot_flag_mask() and > sd_prot_op() are declared non-static. As such, they will be rebuilt for > each respective function call. > > Optimise by making them static. > > This saves ~100B object code

Re: [PATCH] scsi: sd: Make protection lookup tables static

2019-01-07 Thread Bart Van Assche
On Mon, 2019-01-07 at 17:27 +, John Garry wrote: > On 07/01/2019 16:57, Bart Van Assche wrote: > > On Mon, 2019-01-07 at 22:41 +0800, John Garry wrote: > > > Currently the protection lookup tables in sd_prot_flag_mask() and > > > sd_prot_op() are declared non-st

Re: [PATCH v3] coding-style: Clarify the expectations around bool

2019-01-07 Thread Bart Van Assche
l type." > > +evaluate to 0 or 1, and implicit or explicit conversion to bool > > automatically > > +converts the value to true or false. When using bool types the !! > > construction > > +is not needed, which eliminates a class of bugs. > > + > > +When working with bool values the true and false labels should be used > > instead > > true and false are not labels but #defines With these refinements, feel free to add: Reviewed-by: Bart Van Assche

Re: [PATCH net-next] svcrdma: Fix an uninitialized variable false warning

2019-01-03 Thread Bart Van Assche
On Fri, 2018-12-28 at 10:36 -0500, Chuck Lever wrote: > > On Dec 20, 2018, at 4:49 AM, YueHaibing wrote: > > > > smatch warning this: > > net/sunrpc/xprtrdma/svc_rdma_rw.c:351 svc_rdma_post_chunk_ctxt() error: > > uninitialized symbol 'bad_wr' > > net/sunrpc/xprtrdma/verbs.c:1569 rpcrdma_post_re

Re: -Wswitch Clang warnings in drivers/scsi

2018-10-08 Thread Bart Van Assche
On Thu, 2018-10-04 at 23:57 -0700, Nathan Chancellor wrote: > Regardless of how the overflow is handled within the switch statement, > the overflow is also happening when passing in these values to the ioctl, > right? I mean these case values are defined in the uapi files so that > userspace can ea

Re: [PATCH 03/14] blk-mq: provide dummy blk_mq_map_queue_type() helper

2018-10-29 Thread Bart Van Assche
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote: > diff --git a/block/blk-mq.h b/block/blk-mq.h > index 889f0069dd80..79c300faa7ce 100644 > --- a/block/blk-mq.h > +++ b/block/blk-mq.h > @@ -80,6 +80,12 @@ static inline struct blk_mq_hw_ctx > *blk_mq_map_queue(struct request_queue *q, > r

Re: [PATCH 02/14] blk-mq: abstract out queue map

2018-10-29 Thread Bart Van Assche
ewed a later patch in this series. Anyway: Reviewed-by: Bart Van Assche

<    1   2   3   4   5   6   7   8   9   10   >