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
2222 BH_Dirty, /* Is dirty */
2323 BH_Lock, /* Is locked */
2424 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− */
2825
2926 BH_Mapped, /* Has a disk mapping */
3027 BH_New, /* Disk mapping was newly created by get_block */
@@ -76,6 +73,9 @@ struct buffer_head { · 45 unmodified lines
7673 struct address_space *b_assoc_map; /* mapping this buffer is
7774 associated with */
7875 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 */
7979 };
8080
8181 /*