diff options
author | Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> | 2025-07-08 12:20:57 -0700 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2025-10-08 23:30:46 +0200 |
commit | 53db6f25ee47cb1265141d31562604e56146919a (patch) | |
tree | 8fe958fbc7b8a903ab8599dd028ed0cb86f18ff4 /scripts/gdb/linux/timerlist.py | |
parent | 5824ccba9a39a3ad914fc9b2972a2c1119abaac9 (diff) |
ceph: refactor wake_up_bit() pattern of calling
The wake_up_bit() is called in ceph_async_unlink_cb(),
wake_async_create_waiters(), and ceph_finish_async_create().
It makes sense to switch on clear_bit() function, because
it makes the code much cleaner and easier to understand.
More important rework is the adding of smp_mb__after_atomic()
memory barrier after the bit modification and before
wake_up_bit() call. It can prevent potential race condition
of accessing the modified bit in other threads. Luckily,
clear_and_wake_up_bit() already implements the required
functionality pattern:
static inline void clear_and_wake_up_bit(int bit, unsigned long *word)
{
clear_bit_unlock(bit, word);
/* See wake_up_bit() for which memory barrier you need to use. */
smp_mb__after_atomic();
wake_up_bit(word, bit);
}
Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
0 files changed, 0 insertions, 0 deletions