Skip to content

Commit

Permalink
Merge tag 'locking-urgent-2023-09-22' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:
 "Fix a include/linux/atomic/atomic-arch-fallback.h breakage that
  generated incorrect code, and fix a lockdep reporting race that may
  result in lockups"

* tag 'locking-urgent-2023-09-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/seqlock: Do the lockdep annotation before locking in do_write_seqcount_begin_nested()
  locking/atomic: scripts: fix fallback ifdeffery
  • Loading branch information
Linus Torvalds committed Sep 22, 2023
2 parents dc912ba + 41b43b6 commit 725e2d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
10 changes: 1 addition & 9 deletions include/linux/atomic/atomic-arch-fallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ raw_atomic_read_acquire(const atomic_t *v)
{
#if defined(arch_atomic_read_acquire)
return arch_atomic_read_acquire(v);
#elif defined(arch_atomic_read)
return arch_atomic_read(v);
#else
int ret;

Expand Down Expand Up @@ -508,8 +506,6 @@ raw_atomic_set_release(atomic_t *v, int i)
{
#if defined(arch_atomic_set_release)
arch_atomic_set_release(v, i);
#elif defined(arch_atomic_set)
arch_atomic_set(v, i);
#else
if (__native_word(atomic_t)) {
smp_store_release(&(v)->counter, i);
Expand Down Expand Up @@ -2575,8 +2571,6 @@ raw_atomic64_read_acquire(const atomic64_t *v)
{
#if defined(arch_atomic64_read_acquire)
return arch_atomic64_read_acquire(v);
#elif defined(arch_atomic64_read)
return arch_atomic64_read(v);
#else
s64 ret;

Expand Down Expand Up @@ -2624,8 +2618,6 @@ raw_atomic64_set_release(atomic64_t *v, s64 i)
{
#if defined(arch_atomic64_set_release)
arch_atomic64_set_release(v, i);
#elif defined(arch_atomic64_set)
arch_atomic64_set(v, i);
#else
if (__native_word(atomic64_t)) {
smp_store_release(&(v)->counter, i);
Expand Down Expand Up @@ -4657,4 +4649,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v)
}

#endif /* _LINUX_ATOMIC_FALLBACK_H */
// 202b45c7db600ce36198eb1f1fc2c2d5268ace2d
// 2fdd6702823fa842f9cea57a002e6e4476ae780c
2 changes: 1 addition & 1 deletion include/linux/seqlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ do { \

static inline void do_write_seqcount_begin_nested(seqcount_t *s, int subclass)
{
do_raw_write_seqcount_begin(s);
seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_);
do_raw_write_seqcount_begin(s);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/atomic/gen-atomic-fallback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ gen_proto_order_variant()
fi

# Allow ACQUIRE/RELEASE/RELAXED ops to be defined in terms of FULL ops
if [ ! -z "${order}" ]; then
if [ ! -z "${order}" ] && ! meta_is_implicitly_relaxed "${meta}"; then
printf "#elif defined(arch_${basename})\n"
printf "\t${retstmt}arch_${basename}(${args});\n"
fi
Expand Down

0 comments on commit 725e2d7

Please sign in to comment.