Skip to content

Commit a500fc9

Browse files
author
Ingo Molnar
committed
Merge branch 'locking/core' into x86/mm, to resolve conflict
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 <[email protected]>
2 parents d43f17a + bdb1050 commit a500fc9

File tree

7 files changed

+306
-24
lines changed

7 files changed

+306
-24
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,16 @@
784784
cs89x0_media= [HW,NET]
785785
Format: { rj45 | aui | bnc }
786786

787+
csdlock_debug= [KNL] Enable debug add-ons of cross-CPU function call
788+
handling. When switched on, additional debug data is
789+
printed to the console in case a hanging CPU is
790+
detected, and that CPU is pinged again in order to try
791+
to resolve the hang situation.
792+
0: disable csdlock debugging (default)
793+
1: enable basic csdlock debugging (minor impact)
794+
ext: enable extended csdlock debugging (more impact,
795+
but more data)
796+
787797
dasd= [HW,NET]
788798
See header of drivers/s390/block/dasd_devmap.c.
789799

arch/x86/include/asm/jump_label.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <linux/stringify.h>
2121
#include <linux/types.h>
2222

23-
static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
23+
static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch)
2424
{
2525
asm_volatile_goto("1:"
2626
".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
@@ -36,7 +36,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
3636
return true;
3737
}
3838

39-
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
39+
static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch)
4040
{
4141
asm_volatile_goto("1:"
4242
".byte 0xe9\n\t .long %l[l_yes] - 2f\n\t"

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4727,6 +4727,8 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw,
47274727
/* Must not be called with conf_mutex held as workers can use that also. */
47284728
void ath10k_drain_tx(struct ath10k *ar)
47294729
{
4730+
lockdep_assert_not_held(&ar->conf_mutex);
4731+
47304732
/* make sure rcu-protected mac80211 tx path itself is drained */
47314733
synchronize_net();
47324734

include/linux/lockdep.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
268268

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

271+
/* lock_is_held_type() returns */
272+
#define LOCK_STATE_UNKNOWN -1
273+
#define LOCK_STATE_NOT_HELD 0
274+
#define LOCK_STATE_HELD 1
275+
271276
/*
272277
* Same "read" as for lock_acquire(), except -1 means any.
273278
*/
@@ -301,8 +306,14 @@ extern void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie);
301306

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

304-
#define lockdep_assert_held(l) do { \
305-
WARN_ON(debug_locks && !lockdep_is_held(l)); \
309+
#define lockdep_assert_held(l) do { \
310+
WARN_ON(debug_locks && \
311+
lockdep_is_held(l) == LOCK_STATE_NOT_HELD); \
312+
} while (0)
313+
314+
#define lockdep_assert_not_held(l) do { \
315+
WARN_ON(debug_locks && \
316+
lockdep_is_held(l) == LOCK_STATE_HELD); \
306317
} while (0)
307318

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

395406
#define lockdep_assert_held(l) do { (void)(l); } while (0)
396-
#define lockdep_assert_held_write(l) do { (void)(l); } while (0)
407+
#define lockdep_assert_not_held(l) do { (void)(l); } while (0)
408+
#define lockdep_assert_held_write(l) do { (void)(l); } while (0)
397409
#define lockdep_assert_held_read(l) do { (void)(l); } while (0)
398410
#define lockdep_assert_held_once(l) do { (void)(l); } while (0)
399411

kernel/locking/lockdep.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include <linux/nmi.h>
5555
#include <linux/rcupdate.h>
5656
#include <linux/kprobes.h>
57+
#include <linux/lockdep.h>
5758

5859
#include <asm/sections.h>
5960

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

52535254
if (match_held_lock(hlock, lock)) {
52545255
if (read == -1 || hlock->read == read)
5255-
return 1;
5256+
return LOCK_STATE_HELD;
52565257

5257-
return 0;
5258+
return LOCK_STATE_NOT_HELD;
52585259
}
52595260
}
52605261

5261-
return 0;
5262+
return LOCK_STATE_NOT_HELD;
52625263
}
52635264

52645265
static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock)
@@ -5537,10 +5538,14 @@ EXPORT_SYMBOL_GPL(lock_release);
55375538
noinstr int lock_is_held_type(const struct lockdep_map *lock, int read)
55385539
{
55395540
unsigned long flags;
5540-
int ret = 0;
5541+
int ret = LOCK_STATE_NOT_HELD;
55415542

5543+
/*
5544+
* Avoid false negative lockdep_assert_held() and
5545+
* lockdep_assert_not_held().
5546+
*/
55425547
if (unlikely(!lockdep_enabled()))
5543-
return 1; /* avoid false negative lockdep_assert_held() */
5548+
return LOCK_STATE_UNKNOWN;
55445549

55455550
raw_local_irq_save(flags);
55465551
check_flags(flags);

0 commit comments

Comments
 (0)