Skip to content

Commit

Permalink
Merge branch 'locking/core' into x86/mm, to resolve conflict
Browse files Browse the repository at this point in the history
There's a non-trivial conflict between the parallel TLB flush
framework and the IPI flush debugging code - merge them
manually.

Conflicts:
	kernel/smp.c

Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Mar 6, 2021
2 parents d43f17a + bdb1050 commit a500fc9
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 24 deletions.
10 changes: 10 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,16 @@
cs89x0_media= [HW,NET]
Format: { rj45 | aui | bnc }

csdlock_debug= [KNL] Enable debug add-ons of cross-CPU function call
handling. When switched on, additional debug data is
printed to the console in case a hanging CPU is
detected, and that CPU is pinged again in order to try
to resolve the hang situation.
0: disable csdlock debugging (default)
1: enable basic csdlock debugging (minor impact)
ext: enable extended csdlock debugging (more impact,
but more data)

dasd= [HW,NET]
See header of drivers/s390/block/dasd_devmap.c.

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/include/asm/jump_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/stringify.h>
#include <linux/types.h>

static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch)
{
asm_volatile_goto("1:"
".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
Expand All @@ -36,7 +36,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
return true;
}

static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch)
{
asm_volatile_goto("1:"
".byte 0xe9\n\t .long %l[l_yes] - 2f\n\t"
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -4727,6 +4727,8 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw,
/* Must not be called with conf_mutex held as workers can use that also. */
void ath10k_drain_tx(struct ath10k *ar)
{
lockdep_assert_not_held(&ar->conf_mutex);

/* make sure rcu-protected mac80211 tx path itself is drained */
synchronize_net();

Expand Down
18 changes: 15 additions & 3 deletions include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,

extern void lock_release(struct lockdep_map *lock, unsigned long ip);

/* lock_is_held_type() returns */
#define LOCK_STATE_UNKNOWN -1
#define LOCK_STATE_NOT_HELD 0
#define LOCK_STATE_HELD 1

/*
* Same "read" as for lock_acquire(), except -1 means any.
*/
Expand Down Expand Up @@ -301,8 +306,14 @@ extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie);

#define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0)

#define lockdep_assert_held(l) do { \
WARN_ON(debug_locks && !lockdep_is_held(l)); \
#define lockdep_assert_held(l) do { \
WARN_ON(debug_locks && \
lockdep_is_held(l) == LOCK_STATE_NOT_HELD); \
} while (0)

#define lockdep_assert_not_held(l) do { \
WARN_ON(debug_locks && \
lockdep_is_held(l) == LOCK_STATE_HELD); \
} while (0)

#define lockdep_assert_held_write(l) do { \
Expand Down Expand Up @@ -393,7 +404,8 @@ extern int lockdep_is_held(const void *);
#define lockdep_is_held_type(l, r) (1)

#define lockdep_assert_held(l) do { (void)(l); } while (0)
#define lockdep_assert_held_write(l) do { (void)(l); } while (0)
#define lockdep_assert_not_held(l) do { (void)(l); } while (0)
#define lockdep_assert_held_write(l) do { (void)(l); } while (0)
#define lockdep_assert_held_read(l) do { (void)(l); } while (0)
#define lockdep_assert_held_once(l) do { (void)(l); } while (0)

Expand Down
15 changes: 10 additions & 5 deletions kernel/locking/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <linux/nmi.h>
#include <linux/rcupdate.h>
#include <linux/kprobes.h>
#include <linux/lockdep.h>

#include <asm/sections.h>

Expand Down Expand Up @@ -5252,13 +5253,13 @@ int __lock_is_held(const struct lockdep_map *lock, int read)

if (match_held_lock(hlock, lock)) {
if (read == -1 || hlock->read == read)
return 1;
return LOCK_STATE_HELD;

return 0;
return LOCK_STATE_NOT_HELD;
}
}

return 0;
return LOCK_STATE_NOT_HELD;
}

static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock)
Expand Down Expand Up @@ -5537,10 +5538,14 @@ EXPORT_SYMBOL_GPL(lock_release);
noinstr int lock_is_held_type(const struct lockdep_map *lock, int read)
{
unsigned long flags;
int ret = 0;
int ret = LOCK_STATE_NOT_HELD;

/*
* Avoid false negative lockdep_assert_held() and
* lockdep_assert_not_held().
*/
if (unlikely(!lockdep_enabled()))
return 1; /* avoid false negative lockdep_assert_held() */
return LOCK_STATE_UNKNOWN;

raw_local_irq_save(flags);
check_flags(flags);
Expand Down
Loading

0 comments on commit a500fc9

Please sign in to comment.