[tip:locking/core] locking/lockdep: Use expanded masks on find_usage_*() functions

2019-04-18 Thread tip-bot for Frederic Weisbecker
Commit-ID: 627f364d24c009b61c9199b2c75006e35c294675 Gitweb: https://git.kernel.org/tip/627f364d24c009b61c9199b2c75006e35c294675 Author: Frederic Weisbecker AuthorDate: Tue, 2 Apr 2019 18:02:43 +0200 Committer: Ingo Molnar CommitDate: Thu, 18 Apr 2019 12:50:17 +0200 locking/lockdep

[tip:locking/core] locking/lockdep: Map remaining magic numbers to lock usage mask names

2019-04-18 Thread tip-bot for Frederic Weisbecker
Commit-ID: c902a1e8d9c9b47cd8faa16892710247cdda9b02 Gitweb: https://git.kernel.org/tip/c902a1e8d9c9b47cd8faa16892710247cdda9b02 Author: Frederic Weisbecker AuthorDate: Tue, 2 Apr 2019 18:02:42 +0200 Committer: Ingo Molnar CommitDate: Thu, 18 Apr 2019 12:50:17 +0200 locking/lockdep

[tip:locking/core] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING

2019-04-18 Thread tip-bot for Frederic Weisbecker
Commit-ID: 0d2cc3b3453254f1c56f9456ba03e092ed4cfb72 Gitweb: https://git.kernel.org/tip/0d2cc3b3453254f1c56f9456ba03e092ed4cfb72 Author: Frederic Weisbecker AuthorDate: Tue, 2 Apr 2019 18:02:41 +0200 Committer: Ingo Molnar CommitDate: Thu, 18 Apr 2019 12:50:17 +0200 locking/lockdep

Re: [PATCH 4/4] locking/lockdep: Test all incompatible scenario at once in check_irq_usage()

2019-04-16 Thread Frederic Weisbecker
On Tue, Apr 16, 2019 at 01:20:09PM +0200, Peter Zijlstra wrote: > On Sat, Apr 13, 2019 at 02:35:45AM +0200, Frederic Weisbecker wrote: > > On Thu, Apr 11, 2019 at 12:46:32PM +0200, Peter Zijlstra wrote: > > Same here: > > > > As above, we clear bitnr0 (LOCK_*_READ o

Re: [PATCH 4/4] locking/lockdep: Test all incompatible scenario at once in check_irq_usage()

2019-04-12 Thread Frederic Weisbecker
On Thu, Apr 11, 2019 at 12:46:32PM +0200, Peter Zijlstra wrote: > On Wed, Apr 10, 2019 at 04:28:48AM +0200, Frederic Weisbecker wrote: > > Should I re-issue the set or you do the changes? > > I've made it like so; does that work? In particular, do the comments > make sense?

Re: [PATCH 4/4] locking/lockdep: Test all incompatible scenario at once in check_irq_usage()

2019-04-09 Thread Frederic Weisbecker
On Tue, Apr 09, 2019 at 03:03:52PM +0200, Peter Zijlstra wrote: > On Tue, Apr 02, 2019 at 06:02:44PM +0200, Frederic Weisbecker wrote: > > @@ -1988,45 +1961,151 @@ static int exclusive_bit(int new_bit) > > return state | (dir ^ LOCK_USAGE_DIR_MASK); > > } > >

[PATCH 4/4] locking/lockdep: Test all incompatible scenario at once in check_irq_usage()

2019-04-02 Thread Frederic Weisbecker
) Mainline 8452| 2652 |11962 |22415143 This patch 8452| 1518 | 7090 |12835602 Signed-off-by: Frederic Weisbecker Cc: Ingo Molnar Cc: Peter Zijlstra --- kernel/locking/lockdep.c | 212

[PATCH 0/4] lockdep cleanups and optimizations.

2019-04-02 Thread Frederic Weisbecker
: dd2ea3a0bffdc3e140dd4af085bae7f9f9a08d6d Thanks, Frederic --- Frederic Weisbecker (4): locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING locking/lockdep: Map remaining magic numbers to lock usage mask names locking/lockdep: Use expanded masks on fin

[PATCH 1/4] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING

2019-04-02 Thread Frederic Weisbecker
now. So move them inside the appropriate CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING section. Signed-off-by: Frederic Weisbecker Cc: Ingo Molnar Cc: Peter Zijlstra --- kernel/locking/lockdep.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/

[PATCH 2/4] locking/lockdep: Map remaining magic numbers to lock usage mask names

2019-04-02 Thread Frederic Weisbecker
Clarify the code with mapping some more constant numbers that haven't been named after their corresponding LOCK_USAGE_* symbol. Signed-off-by: Frederic Weisbecker Cc: Ingo Molnar Cc: Peter Zijlstra --- kernel/locking/lockdep.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions

[PATCH 3/4] locking/lockdep: Use expanded masks on find_usage_*() functions

2019-04-02 Thread Frederic Weisbecker
In order to optimize check_irq_usage() and factorize all the IRQ usage validations we'll need to be able to check multiple lock usage bits at once. Prepare the low level usage mask check functions for that purpose. Signed-off-by: Frederic Weisbecker Cc: Ingo Molnar Cc: Peter Zijlstra

Re: WARNING in arch_install_hw_breakpoint

2019-03-27 Thread Frederic Weisbecker
On Wed, Mar 27, 2019 at 06:48:41PM +0100, Borislav Petkov wrote: > On Wed, Mar 27, 2019 at 04:17:25PM +0100, Borislav Petkov wrote: > Ok, after adding some debug output, it looks like this (newlines mine): > > [ 200.921625][ T8029]repro-80290d..4 200923254us : >

Re: [PATCH 00/37] softirq: Per vector masking v3

2019-03-08 Thread Frederic Weisbecker
On Fri, Mar 01, 2019 at 08:51:38AM -0800, Linus Torvalds wrote: > On Thu, Feb 28, 2019 at 7:45 PM Frederic Weisbecker > wrote: > > > > Numbers are indeed missing. In fact this patchset mostly just brings an > > infrastructure. We have yet to pinpoint the most late

Re: [PATCH 00/37] softirq: Per vector masking v3

2019-02-28 Thread Frederic Weisbecker
On Thu, Feb 28, 2019 at 09:33:15AM -0800, Linus Torvalds wrote: > On Thu, Feb 28, 2019 at 9:12 AM Frederic Weisbecker > wrote: > > > > So this set should hopefully address all reviews from the v2, and > > fix all reports from the extremely useful (as always) Kbuild

[PATCH 19/37] softirq: Convert softirq_pending_*() to set/clear mask scheme

2019-02-28 Thread Frederic Weisbecker
-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds Cc: Peter Zijlstra --- arch/s390/include/asm/hardirq.h | 4

[PATCH 07/37] locking/lockdep: Prepare valid_state() to handle plain masks

2019-02-28 Thread Frederic Weisbecker
mark_lock_irq() is going to deal with lock usages that gather multiple softirq vectors at once. Therefore the validation through valid_state() will need to handle expanded usage masks. So enhance valid_state() to that purpose. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc

[PATCH 13/37] softirq: Macrofy softirq vectors

2019-02-28 Thread Frederic Weisbecker
Define the softirq vectors through macros so that we can later include them in the automated definition of lockdep usage states. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E

[PATCH 33/37] locking/lockdep: Update check_flags() according to new layout

2019-02-28 Thread Frederic Weisbecker
check to the updated semantics. We can't deduce much from softirq_count() alone anymore except when it's 0. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc

[PATCH 29/37] softirq: Uninline !CONFIG_TRACE_IRQFLAGS __local_bh_disable_ip()

2019-02-28 Thread Frederic Weisbecker
The common code between both versions of __local_bh_disable_ip(), whether CONFIG_TRACE_IRQFLAGS is on or off, is going to grow up in order to support vector masking granularity. Merge these versions together to prepare for that. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker

[PATCH 22/37] softirq: Move vectors bits to bottom_half.h

2019-02-28 Thread Frederic Weisbecker
From: Frederic Weisbecker Using the bottom-half masking APIs defined in linux/bottom-half.h won't be possible without passing the relevant softirq vectors that are currently defined in linux/interrupt.h Yet we can't include linux/interrupt.h from linux/bottom-half.h due to circular dependencies

[PATCH 23/37] x86: Init softirq enabled field

2019-02-28 Thread Frederic Weisbecker
From: Frederic Weisbecker All softirqs must be set enabled on boot. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc

[PATCH 32/37] locking/lockdep: Remove redundant softirqs on check

2019-02-28 Thread Frederic Weisbecker
viewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds Cc: Peter Zijlstra --- kernel/l

[PATCH 27/37] softirq: Check enabled vectors before processing

2019-02-28 Thread Frederic Weisbecker
There is no need to process softirqs if none of those pending are enabled. Check about that early to avoid unnecessary overhead. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E

[PATCH 30/37] softirq: Prepare for mixing all/per-vector masking

2019-02-28 Thread Frederic Weisbecker
ror of softirq_count() because there is no per vector masking API yet. When this full masking counter is non 0, all softirq vectors are explicitly disabled. Suggested-by: Linus Torvalds Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc:

[PATCH 35/37] softirq: Allow to soft interrupt vector-specific masked contexts

2019-02-28 Thread Frederic Weisbecker
Remove the old protections that prevented softirqs from interrupting any softirq-disabled context. Now that we can disable specific vectors on a given piece of code, we want to be able to soft-interrupt those places with other vectors. Reviewed-by: David S. Miller Signed-off-by: Frederic

[PATCH 37/37] net: Make softirq vector masking finegrained on release_sock()

2019-02-28 Thread Frederic Weisbecker
This is a usage example of spin_lock_bh_mask(). NET_RX, TIMER and TASKLET are the three softirqs that have been reported by lockdep to be used for this socket lock, at least on my own usecases. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel

[PATCH 28/37] softirq: Remove stale comment

2019-02-28 Thread Frederic Weisbecker
__local_bh_disable_ip() is neither for strict internal use nor does it require the caller to disable hardirqs. Probaby a celebration for ancient behaviour. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc

[PATCH 31/37] softirq: Support per vector masking

2019-02-28 Thread Frederic Weisbecker
state with NET_RX_SOFTIRQ disabled local_bh_enable_mask(bh); Suggested-by: Linus Torvalds Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Moln

[PATCH 36/37] locking: Introduce spin_[un]lock_bh_mask()

2019-02-28 Thread Frederic Weisbecker
)); [...] spin_unlock_bh_mask(lock, bh); Suggested-by: Linus Torvalds Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej

[PATCH 34/37] locking/lockdep: Branch the new vec-finegrained softirq masking to lockdep

2019-02-28 Thread Frederic Weisbecker
ied by lockdep_softirq_enter/exit() Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior

[PATCH 26/37] softirq: Init softirq enabled field for default irq_stat definition

2019-02-28 Thread Frederic Weisbecker
From: Frederic Weisbecker All softirqs must be set enabled on boot. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus

[PATCH 25/37] powerpc: Init softirq enabled field

2019-02-28 Thread Frederic Weisbecker
From: Frederic Weisbecker All softirqs must be set enabled on boot. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus

[PATCH 17/37] arch/softirq: Rename softirq_pending fields to softirq_data

2019-02-28 Thread Frederic Weisbecker
We are going to extend the softirq bits with an enabled vector mask. Provide the field with a more generic name to later layout the pending states on the lower bits and the enabled states on the higher bits. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho

[PATCH 16/37] x86: Revert "x86/irq: Demote irq_cpustat_t::__softirq_pending to u16"

2019-02-28 Thread Frederic Weisbecker
This reverts commit 9aee5f8a7e30330d0a8f4c626dc924ca5590aba5. We are going to need the 16 high bits above in order to implement a softirq enable mask. x86 is the only architecture that doesn't use unsigned int to implement softirq_pending. Reviewed-by: David S. Miller Signed-off-by: Frederic

[PATCH 20/37] softirq: Introduce disabled softirq vectors bits

2019-02-28 Thread Frederic Weisbecker
is to provide the necessary APIs to control the per-vector enable bits. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc

[PATCH 15/37] softirq: Pass softirq vector number to lockdep on vector execution

2019-02-28 Thread Frederic Weisbecker
Pass the softirq vector number to lockdep on callback execution so that we know which one is involved while holding a lock. We will then be able to pick up the proper LOCK_USED_IN_*_SOFTIRQ index to perform the finegrained verifications. Reviewed-by: David S. Miller Signed-off-by: Frederic

[PATCH 21/37] softirq: Rename _local_bh_enable() to local_bh_enable_no_softirq()

2019-02-28 Thread Frederic Weisbecker
version that won't execute do_softirq() in the end. Clarify this straight in the name. It may help reviewers who are already familiar with functions such as preempt_enable_no_resched(). Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes

[PATCH 18/37] softirq: Normalize softirq_pending naming scheme

2019-02-28 Thread Frederic Weisbecker
From: Frederic Weisbecker Use the subsystem as the prefix to name the __softirq_data accessors. They are going to be extended and want a more greppable and standard naming sheme. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc

[PATCH 24/37] parisc: Init softirq enabled field

2019-02-28 Thread Frederic Weisbecker
From: Frederic Weisbecker All softirqs must be set enabled on boot. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus

[PATCH 14/37] locking/lockdep: Define per vector softirq lock usage states

2019-02-28 Thread Frederic Weisbecker
| | | | RCU_SOFTIRQHI_SOFTIRQ bits bits Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S

[PATCH 12/37] locking/lockdep: Report all usages on mark_lock() verbosity mode

2019-02-28 Thread Frederic Weisbecker
Since mark_lock() may now be passed more than one usage at once, make sure to expand the lock usage structure in order to report all of them while in verbose mode logging. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc

[PATCH 11/37] locking/lockdep: Save stack trace for each softirq vector involved

2019-02-28 Thread Frederic Weisbecker
We are going to save as much traces as we have softirq vectors involved in a given usage. Expand the stack trace record code accordingly. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc

[PATCH 10/37] locking/lockdep: Make mark_lock() fastpath to work with multiple usage at once

2019-02-28 Thread Frederic Weisbecker
. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds Cc: Peter Zijlstra --- kernel/locking/lockdep.c | 4

[PATCH 09/37] locking/lockdep: Prepare state_verbose() to handle all softirqs

2019-02-28 Thread Frederic Weisbecker
Loosely handle all the softirq vectors verbosity under the same function. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc

[PATCH 08/37] locking/lockdep: Prepare check_usage_*() to handle plain masks

2019-02-28 Thread Frederic Weisbecker
Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds Cc: Peter Zijlstra --- kernel/locking/lockdep.c | 30

[PATCH 06/37] locking/lockdep: Test all incompatible scenario at once in check_irq_usage()

2019-02-28 Thread Frederic Weisbecker
and @lockB If no incompatible use is found, the verification never goes beyond step 2 which means at most two iterations. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc

[PATCH 02/37] locking/lockdep: Use expanded masks on find_usage_*() functions

2019-02-28 Thread Frederic Weisbecker
In order to perform softirq vector-finegrained locking validation we'll need to be able to check multiple vector usages at once. Prepare the low level usage mask check functions for that purpose. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel

[PATCH 04/37] locking/lockdep: Convert usage_mask to u64

2019-02-28 Thread Frederic Weisbecker
have 4 hardirq bits + NR_SOFTIRQS * 4 + 1 bit (LOCK_USED) = 45 bits. Therefore we need a 64 bits mask. Reviewed-by: David S. Miller Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller

[PATCH 00/37] softirq: Per vector masking v3

2019-02-28 Thread Frederic Weisbecker
.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git softirq/soft-interruptible-v2 HEAD: 63c89028058f5920d4b5a9d38452fa4623469583 Thanks, Frederic --- Frederic Weisbecker (37): locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKI

[PATCH 01/37] locking/lockdep: Move valid_state() inside CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING

2019-02-28 Thread Frederic Weisbecker
valid_state() and print_usage*() functions are not used beyond locking correctness checks. So move them inside the appropriate CONFIG_TRACE_IRQFLAGS && CONFIG_PROVE_LOCKING section. Sadly the "unused function" warning wouldn't fire because valid_state() is inline. Signe

[PATCH 05/37] locking/lockdep: Introduce lock usage mask iterator

2019-02-28 Thread Frederic Weisbecker
as it has unpredictable behaviour, depending on architecture backend. Therefore the shift on each iteration is cut in two parts: 1) Shift by the first set bit number (can't exceed 63) 2) Shift again by 1 because __ffs64() counts from zero Inspired-by: Linus Torvalds Signed-off-by: Frederic

[PATCH 03/37] locking/lockdep: Introduce struct lock_usage

2019-02-28 Thread Frederic Weisbecker
usage, lower level functions dealing with validation can expand the struct lock_usage to a usage mask through lock_usage_mask(). For now, vector is always 0 until we get the proper vector finegrained informations on softirq usage events. Reviewed-by: David S. Miller Signed-off-by: Frederic

Re: [PATCH 24/32] softirq: Uninline !CONFIG_TRACE_IRQFLAGS __local_bh_disable_ip()

2019-02-27 Thread Frederic Weisbecker
On Wed, Feb 27, 2019 at 12:14:29PM +0100, Sebastian Andrzej Siewior wrote: > On 2019-02-12 18:14:15 [+0100], Frederic Weisbecker wrote: > > diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h > > index 240419382978..ef9e4c752f56 100644 > > --- a/includ

Re: [PATCH 23/32] softirq: Remove stale comment

2019-02-27 Thread Frederic Weisbecker
On Wed, Feb 27, 2019 at 12:04:04PM +0100, Sebastian Andrzej Siewior wrote: > On 2019-02-12 18:14:14 [+0100], Frederic Weisbecker wrote: > > __local_bh_disable_ip() is neither for strict internal use nor does it > > require the caller to disable hardirqs. Probaby a celebrat

Re: [PATCH 11/32] softirq: Macrofy softirq vectors

2019-02-27 Thread Frederic Weisbecker
On Wed, Feb 27, 2019 at 10:54:10AM +0100, Sebastian Andrzej Siewior wrote: > On 2019-02-12 18:14:02 [+0100], Frederic Weisbecker wrote: > > --- /dev/null > > +++ b/include/linux/softirq_vector.h > > @@ -0,0 +1,10 @@ > could you please add a spdx header/identifier here? Ah right, will do. Thanks.

Re: [PATCH 05/32] locking/lockdep: Prepare valid_state() to handle plain masks

2019-02-20 Thread Frederic Weisbecker
On Wed, Feb 13, 2019 at 11:47:13AM -0800, Linus Torvalds wrote: > On Wed, Feb 13, 2019 at 7:16 AM Frederic Weisbecker > wrote: > > > > > > If "vectors" only has the high hit set, you end up with "fs" having > > > the value "64"

Re: Fix 80d20d35af1e ("nohz: Fix local_timer_softirq_pending()") may have revealed another problem

2019-02-14 Thread Frederic Weisbecker
On Thu, Feb 14, 2019 at 11:33:44PM +0100, Heiner Kallweit wrote: > On 14.02.2019 22:47, Thomas Gleixner wrote: > > On Thu, 14 Feb 2019, Heiner Kallweit wrote: > >> On 24.01.2019 20:37, Heiner Kallweit wrote: > > >>> Hi Frederic, > >>> is the update debug patch still to come? > > > > Heiner,

Re: [PATCH 09/32] locking/lockdep: Save stack trace for each softirq vector involved

2019-02-13 Thread Frederic Weisbecker
On Tue, Feb 12, 2019 at 09:47:39AM -0800, Linus Torvalds wrote: > On Tue, Feb 12, 2019 at 9:15 AM Frederic Weisbecker > wrote: > > > > > > +static int save_trace_mask(struct lock_class *class, u64 mask) > > +{ > > + int bit = 0; > > + > > +

Re: [PATCH 05/32] locking/lockdep: Prepare valid_state() to handle plain masks

2019-02-13 Thread Frederic Weisbecker
On Tue, Feb 12, 2019 at 09:45:52AM -0800, Linus Torvalds wrote: > On Tue, Feb 12, 2019 at 9:14 AM Frederic Weisbecker > wrote: > > > > + > > + while (vectors) { > > + long fs = __ffs64(vectors) + 1; > > + > > +

Re: [PATCH 02/32] locking/lockdep: Introduce struct lock_usage

2019-02-13 Thread Frederic Weisbecker
On Tue, Feb 12, 2019 at 09:38:42AM -0800, Linus Torvalds wrote: > On Tue, Feb 12, 2019 at 9:14 AM Frederic Weisbecker > wrote: > > > > +static u64 lock_usage_mask(struct lock_usage *usage) > > +{ > > + return BIT(usage->bit); > > +} > >

Re: [PATCH 03/32] locking/lockdep: Convert usage_mask to u64

2019-02-13 Thread Frederic Weisbecker
On Tue, Feb 12, 2019 at 09:40:09AM -0800, Linus Torvalds wrote: > On Tue, Feb 12, 2019 at 9:14 AM Frederic Weisbecker > wrote: > > > > The usage mask is going to expand to validate softirq related usages in > > a per-vector finegrained way. > > So here you s

Re: preempt.h: some SOFTIRQ_OFFSET should be SOFTIRQ_MASK?

2019-02-12 Thread Frederic Weisbecker
On Tue, Feb 05, 2019 at 07:34:31PM +0100, Denys Vlasenko wrote: > SOFTIRQ is a counter. > Why here: > > #define in_serving_softirq()(softirq_count() & SOFTIRQ_OFFSET) > #define in_task() (!(preempt_count() & \ >(NMI_MASK | HARDIRQ_MASK | >

[PATCH 23/32] softirq: Remove stale comment

2019-02-12 Thread Frederic Weisbecker
__local_bh_disable_ip() is neither for strict internal use nor does it require the caller to disable hardirqs. Probaby a celebration for ancient behaviour. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E

[PATCH 27/32] locking/lockdep: Remove redundant softirqs on check

2019-02-12 Thread Frederic Weisbecker
ed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds Cc: Peter Zijlstra --- kernel/locking/lockdep.c

[PATCH 14/32] x86: Revert "x86/irq: Demote irq_cpustat_t::__softirq_pending to u16"

2019-02-12 Thread Frederic Weisbecker
This reverts commit 9aee5f8a7e30330d0a8f4c626dc924ca5590aba5. We are going to need the 16 high bits above in order to implement a softirq enable mask. x86 is the only architecture that doesn't use unsigned int to implement softirq_pending. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho

[PATCH 32/32] net: Make softirq vector masking finegrained on release_sock()

2019-02-12 Thread Frederic Weisbecker
This is a usage example of spin_lock_bh_mask(). NET_RX, TIMER and TASKLET are the three softirqs that have been reported by lockdep to be used for this socket lock, at least on my own usecases. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner

[PATCH 00/32] softirq: Per vector masking v2

2019-02-12 Thread Frederic Weisbecker
bf Thanks, Frederic --- Frederic Weisbecker (32): locking/lockdep: Use expanded masks on find_usage_*() functions locking/lockdep: Introduce struct lock_usage locking/lockdep: Convert usage_mask to u64 locking/lockdep: Test all incompatible scenario at once in check

[PATCH 29/32] locking/lockdep: Branch the new vec-finegrained softirq masking to lockdep

2019-02-12 Thread Frederic Weisbecker
ied by lockdep_softirq_enter/exit() Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds Cc: Pe

[PATCH 31/32] locking: Introduce spin_[un]lock_bh_mask()

2019-02-12 Thread Frederic Weisbecker
)); [...] spin_unlock_bh_mask(lock, bh); Suggested-by: Linus Torvalds Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus Torvalds

[PATCH 19/32] softirq: Rename _local_bh_enable() to local_bh_enable_no_softirq()

2019-02-12 Thread Frederic Weisbecker
version that won't execute do_softirq() in the end. Clarify this straight in the name. It may help reviewers who are already familiar with functions such as preempt_enable_no_resched(). Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc

[PATCH 20/32] softirq: Move vectors bits to bottom_half.h

2019-02-12 Thread Frederic Weisbecker
From: Frederic Weisbecker Using the bottom-half masking APIs defined in linux/bottom-half.h won't be possible without passing the relevant softirq vectors that are currently defined in linux/interrupt.h Yet we can't include linux/interrupt.h from linux/bottom-half.h due to circular dependencies

[PATCH 26/32] softirq: Support per vector masking

2019-02-12 Thread Frederic Weisbecker
state with NET_RX_SOFTIRQ disabled local_bh_enable_mask(bh); Suggested-by: Linus Torvalds Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewi

[PATCH 21/32] x86: Init softirq enabled field

2019-02-12 Thread Frederic Weisbecker
From: Frederic Weisbecker All softirqs must be set enabled on boot. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus

[PATCH 25/32] softirq: Prepare for mixing all/per-vector masking

2019-02-12 Thread Frederic Weisbecker
ror of softirq_count() because there is no per vector masking API yet. When this full masking counter is non 0, all softirq vectors are explicitly disabled. Suggested-by: Linus Torvalds Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan

[PATCH 22/32] softirq: Check enabled vectors before processing

2019-02-12 Thread Frederic Weisbecker
There is no need to process softirqs if none of those pending are enabled. Check about that early to avoid unnecessary overhead. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller

[PATCH 24/32] softirq: Uninline !CONFIG_TRACE_IRQFLAGS __local_bh_disable_ip()

2019-02-12 Thread Frederic Weisbecker
The common code between both versions of __local_bh_disable_ip(), whether CONFIG_TRACE_IRQFLAGS is on or off, is going to grow up in order to support vector masking granularity. Merge these versions together to prepare for that. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc

[PATCH 30/32] softirq: Allow to soft interrupt vector-specific masked contexts

2019-02-12 Thread Frederic Weisbecker
Remove the old protections that prevented softirqs from interrupting any softirq-disabled context. Now that we can disable specific vectors on a given piece of code, we want to be able to soft-interrupt those places with other vectors. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab

[PATCH 10/32] locking/lockdep: Make mark_lock() verbosity aware of vector

2019-02-12 Thread Frederic Weisbecker
Expand the effective usage bit on top of the lock usage bit/vector pair while in verbose mode logging in mark_lock(). FIXME: This only handle the first bit in the mask. We may need to iterate over all of them. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc

[PATCH 07/32] locking/lockdep: Prepare state_verbose() to handle all softirqs

2019-02-12 Thread Frederic Weisbecker
Loosely handle all the softirq vectors verbosity under the same function. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc

[PATCH 28/32] locking/lockdep: Update check_flags() according to new layout

2019-02-12 Thread Frederic Weisbecker
check to the updated semantics. We can't deduce much from softirq_count() alone anymore except when it's 0. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian A

[PATCH 05/32] locking/lockdep: Prepare valid_state() to handle plain masks

2019-02-12 Thread Frederic Weisbecker
mark_lock_irq() is going to deal with lock usages that gather multiple softirq vectors at once. Therefore the validation through valid_state() will need to handle expanded usage masks. So enhance valid_state() to that purpose. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc

[PATCH 12/32] locking/lockdep: Define per vector softirq lock usage states

2019-02-12 Thread Frederic Weisbecker
| | | | RCU_SOFTIRQHI_SOFTIRQ bits bits Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc

[PATCH 13/32] softirq: Pass softirq vector number to lockdep on vector execution

2019-02-12 Thread Frederic Weisbecker
Pass the softirq vector number to lockdep on callback execution so that we know which one is involved while holding a lock. We will then be able to pick up the proper LOCK_USED_IN_*_SOFTIRQ index to perform the finegrained verifications. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho

[PATCH 06/32] locking/lockdep: Prepare check_usage_*() to handle plain masks

2019-02-12 Thread Frederic Weisbecker
mark_lock_irq() is going to deal with lock usages that gather multiple softirq vectors at once. Therefore the validation through check_usage_backwards() and check_usage_forwards() will need to handle expanded usage masks. So enhance those functions to that purpose. Signed-off-by: Frederic

[PATCH 08/32] locking/lockdep: Make mark_lock() fastpath to work with multiple usage at once

2019-02-12 Thread Frederic Weisbecker
and not for others, we may spuriously ignore all the verifications for the new vectors. What we must check instead is a bit different: we have to make sure that the new usage with all its vectors are entirely present in the current usage mask before ignoring further checks. Signed-off-by: Frederic

[PATCH 09/32] locking/lockdep: Save stack trace for each softirq vector involved

2019-02-12 Thread Frederic Weisbecker
We are going to save as much traces as we have softirq vectors involved in a given usage. Expand the stack trace record code accordingly. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S

[PATCH 11/32] softirq: Macrofy softirq vectors

2019-02-12 Thread Frederic Weisbecker
Define the softirq vectors through macros so that we can later include them in the automated definition of lockdep usage states. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller

[PATCH 04/32] locking/lockdep: Test all incompatible scenario at once in check_irq_usage()

2019-02-12 Thread Frederic Weisbecker
and @lockB If no incompatible use is found, the verification never goes beyond step 2 which means at most two iterations. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar

[PATCH 15/32] arch/softirq: Rename softirq_pending fields to softirq_data

2019-02-12 Thread Frederic Weisbecker
We are going to extend the softirq bits with an enabled vector mask. Provide the field with a more generic name to later layout the pending states on the lower bits and the enabled states on the higher bits. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc

[PATCH 17/32] softirq: Convert softirq_pending_*() to set/clear mask scheme

2019-02-12 Thread Frederic Weisbecker
We are going to need a nand version of softirq_pending_or() in order to clear specific bits from the pending mask. But instead of naming the mutators after their implementation, rather name them after their high level purpose. Suggested-by: Linus Torvalds Signed-off-by: Frederic Weisbecker Cc

[PATCH 18/32] softirq: Introduce disabled softirq vectors bits

2019-02-12 Thread Frederic Weisbecker
is to provide the necessary APIs to control the per-vector enable bits. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Linus

[PATCH 16/32] softirq: Normalize softirq_pending naming scheme

2019-02-12 Thread Frederic Weisbecker
From: Frederic Weisbecker Use the subsystem as the prefix to name the __softirq_data accessors. They are going to be extended and want a more greppable and standard naming sheme. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan

[PATCH 01/32] locking/lockdep: Use expanded masks on find_usage_*() functions

2019-02-12 Thread Frederic Weisbecker
In order to perform softirq vector-finegrained locking validation we'll need to be able to check multiple vector usages at once. Prepare the low level usage mask check functions for that purpose. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas

[PATCH 03/32] locking/lockdep: Convert usage_mask to u64

2019-02-12 Thread Frederic Weisbecker
have 4 hardirq bits + NR_SOFTIRQS * 4 + 1 bit (LOCK_USED) = 45 bits. Therefore we need a 64 bits mask. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab Cc: Joel Fernandes Cc: Thomas Gleixner Cc: Pavan Kondeti Cc: Paul E . McKenney Cc: David S . Miller Cc: Ingo Molnar Cc

[PATCH 02/32] locking/lockdep: Introduce struct lock_usage

2019-02-12 Thread Frederic Weisbecker
usage, lower level functions dealing with validation can expand the struct lock_usage to a usage mask through lock_usage_mask(). For now, vector is always 0 until we get the proper vector finegrained informations on softirq usage events. Signed-off-by: Frederic Weisbecker Cc: Mauro Carvalho Chehab

Re: [RFC PATCH] time/nohz: allow the boot CPU to be nohz_full

2019-01-23 Thread Frederic Weisbecker
On Wed, Jan 23, 2019 at 06:25:26PM +1000, Nicholas Piggin wrote: > Frederic Weisbecker's on January 17, 2019 3:54 am: > > On Mon, Jan 14, 2019 at 04:47:45PM +1000, Nicholas Piggin wrote: > >> We have a supercomputer site testing nohz_full to reduce jitter with > >> good results, but they want CPU0

[tip:locking/core] locking/lockdep: Provide enum lock_usage_bit mask names

2019-01-21 Thread tip-bot for Frederic Weisbecker
Commit-ID: bba2a8f1f974a45ca6ceaf688b2be7bc1c418a2f Gitweb: https://git.kernel.org/tip/bba2a8f1f974a45ca6ceaf688b2be7bc1c418a2f Author: Frederic Weisbecker AuthorDate: Fri, 28 Dec 2018 06:02:01 +0100 Committer: Ingo Molnar CommitDate: Mon, 21 Jan 2019 11:18:56 +0100 locking/lockdep

[tip:locking/core] locking/lockdep: Simplify mark_held_locks()

2019-01-21 Thread tip-bot for Frederic Weisbecker
Commit-ID: 436a49ae7b693161c4fdf98b575ef16243dc2dfa Gitweb: https://git.kernel.org/tip/436a49ae7b693161c4fdf98b575ef16243dc2dfa Author: Frederic Weisbecker AuthorDate: Fri, 28 Dec 2018 06:02:00 +0100 Committer: Ingo Molnar CommitDate: Mon, 21 Jan 2019 11:18:54 +0100 locking/lockdep

Re: [RFC PATCH] time/nohz: allow the boot CPU to be nohz_full

2019-01-16 Thread Frederic Weisbecker
On Mon, Jan 14, 2019 at 04:47:45PM +1000, Nicholas Piggin wrote: > We have a supercomputer site testing nohz_full to reduce jitter with > good results, but they want CPU0 to be nohz_full. That happens to be > the boot CPU, which is disallowed by the nohz_full code. > > They have existing job

Re: Fix 80d20d35af1e ("nohz: Fix local_timer_softirq_pending()") may have revealed another problem

2019-01-15 Thread Frederic Weisbecker
On Fri, Dec 28, 2018 at 12:11:12AM +0100, Heiner Kallweit wrote: > > # tracer: nop > # > # _-=> irqs-off > # / _=> need-resched > #| / _---=> hardirq/softirq > #|| / _--=>

<    3   4   5   6   7   8   9   10   11   12   >