Skip to content

fs: Substitute bit-spinlocks for PREEMPT_RT and debugging

Thomas Gleixner linux-ext4 linux-fsdevel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 19 repliesIn review
  2. v14 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Collected reviewed-by tags for the BH_Uptodate part

- Reworked the JBD2 part according to Jan's review:

- Convert state lock to a regular spinlock unconditionally

- Refactor jbd2_journal_put_journal_head() to be RT friendly by restricting the bit-spinlock held section to the minimum required operations.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7locking/lockdep: Add Kconfig option for bit spinlockslib/Kconfig.debug+10 -00 replies
2/7fs/buffer: Move BH_Uptodate_Lock locking into wrapper functionsfs/buffer.c fs/ext4/page-io.c fs/ntfs/aops.c +1 more+27 -250 replies
3/7fs/buffer: Substitute BH_Uptodate_Lock for RT and bit spinlock debuggingfs/buffer.c include/linux/buffer_head.h+32 -00 replies
4/7fs/jbd2: Remove jbd_trylock_bh_state()include/linux/jbd2.h+0 -51 reply
5/7fs/jbd2: Simplify journal_unmap_buffer()fs/jbd2/transaction.c+2 -61 reply
6/7fs/jbd2: Make state lock a spinlockfs/jbd2/commit.c fs/jbd2/journal.c fs/jbd2/transaction.c +3 more+77 -826 replies
7/7fs/jbd2: Free journal head outside of locked regionfs/jbd2/journal.c+20 -82 replies

Reviews trailers per patch

4 of 7 patches have a Reviewed-by or Acked-by.

PatchJan Kara
1/7
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [patch V2 0/7] fs: Substitute bit-spinlocks for PREEMPT_RT and debugging

Bit spinlocks are problematic if PREEMPT_RT is enabled. 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.

Bit spinlocks are also not covered by lock debugging, e.g. lockdep. With the spinlock substitution in place, they can be exposed via a new config
switch: CONFIG_DEBUG_BIT_SPINLOCKS.

This series handles only buffer head and jbd2, but does not touch the hlist_bl bit-spinlock usage. See V1 for further details:

https://lkml.kernel.org/r/[email protected]

Changes vs. V1:

- Collected reviewed-by tags for the BH_Uptodate part

- Reworked the JBD2 part according to Jan's review:

- Convert state lock to a regular spinlock unconditionally

- Refactor jbd2_journal_put_journal_head() to be RT friendly by restricting the bit-spinlock held section to the minimum required operations.

That part is probably over-engineered, but I'm sure Jan will tell me sooner than later.

Thanks,

tglx