History

fs/buffer: Make BH_Uptodate_Lock bit_spin_lock a regular spinlock_t

Bit spinlocks are problematic if PREEMPT_RT is enabled, because they disable preemption, which is undesired for latency reasons and breaks when regular spinlocks are taken within the bit_spinlock locked region because regular spinlocks are converted to 'sleeping spinlocks' on RT. PREEMPT_RT replaced the bit spinlocks with regular spinlocks to avoid this problem. The replacement was done conditionaly at compile time, but Christoph requested to do an unconditional conversion. Jan suggested to move the spinlock into a existing padding hole which avoids a size increase of struct buffer_head on production kernels. As a benefit the lock gains lockdep coverage. [ bigeasy: Remove the wrapper and use always spinlock_t and move it into the padding hole ]

Thomas Gleixner committed 6 years ago

Commit f1e67e31 parent fc321504 files · +16 −26Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/buffer_head.h+3−3
@@ -22,9 +22,6 @@ enum bh_state_bits { · 21 unmodified lines
22 BH_Dirty, /* Is dirty */22 BH_Dirty, /* Is dirty */
23 BH_Lock, /* Is locked */23 BH_Lock, /* Is locked */
24 BH_Req, /* Has been submitted for I/O */24 BH_Req, /* Has been submitted for I/O */
25 BH_Uptodate_Lock,/* Used by the first bh in a page, to serialise
26 * IO completion of other buffers in the page
27 */
28 25
29 BH_Mapped, /* Has a disk mapping */26 BH_Mapped, /* Has a disk mapping */
30 BH_New, /* Disk mapping was newly created by get_block */27 BH_New, /* Disk mapping was newly created by get_block */
@@ -76,6 +73,9 @@ struct buffer_head { · 45 unmodified lines
76 struct address_space *b_assoc_map; /* mapping this buffer is73 struct address_space *b_assoc_map; /* mapping this buffer is
77 associated with */74 associated with */
78 atomic_t b_count; /* users using this buffer_head */75 atomic_t b_count; /* users using this buffer_head */
76 spinlock_t b_uptodate_lock; /* Used by the first bh in a page, to
77 * serialise IO completion of other
78 * buffers in the page */
79};79};
80 80
81/*81/*