Skip to content

Commit

Permalink
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/s…
Browse files Browse the repository at this point in the history
…cm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:
 "A lockdep warning fix and a script execution fix when atomics are
  generated"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/atomics: Don't assume that scripts are executable
  locking/lockdep: Make lockdep_unregister_key() honor 'debug_locks' again
  • Loading branch information
torvalds committed Apr 20, 2019
2 parents 371dd43 + b50776a commit de3af9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions kernel/locking/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -4907,8 +4907,9 @@ void lockdep_unregister_key(struct lock_class_key *key)
return;

raw_local_irq_save(flags);
arch_spin_lock(&lockdep_lock);
current->lockdep_recursion = 1;
if (!graph_lock())
goto out_irq;

pf = get_pending_free();
hlist_for_each_entry_rcu(k, hash_head, hash_entry) {
if (k == key) {
Expand All @@ -4920,8 +4921,8 @@ void lockdep_unregister_key(struct lock_class_key *key)
WARN_ON_ONCE(!found);
__lockdep_free_key_range(pf, key, 1);
call_rcu_zapped(pf);
current->lockdep_recursion = 0;
arch_spin_unlock(&lockdep_lock);
graph_unlock();
out_irq:
raw_local_irq_restore(flags);

/* Wait until is_dynamic_key() has finished accessing k->hash_entry. */
Expand Down
2 changes: 1 addition & 1 deletion scripts/atomic/gen-atomics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gen-atomic-long.sh asm-generic/atomic-long.h
gen-atomic-fallback.sh linux/atomic-fallback.h
EOF
while read script header; do
${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
/bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
HASH="$(sha1sum ${LINUXDIR}/include/${header})"
HASH="${HASH%% *}"
printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
Expand Down

0 comments on commit de3af9a

Please sign in to comment.