diff --git a/arch/Kconfig b/arch/Kconfig index bf26a05e54460f1ebc0b8e5647a151fa18abc260..02ea1e71033e2638c2f85c271db07c261c4f5c3e 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -37,6 +37,7 @@ config OPROFILE tristate "OProfile system profiling" depends on PROFILING depends on HAVE_OPROFILE + depends on !PREEMPT_RT select RING_BUFFER select RING_BUFFER_ALLOW_SWAP help diff --git a/fs/dcache.c b/fs/dcache.c index 053cd09a2a1fe604a702f0fa24b4a157af48ff8a..3162f123142cda0183fec50ecbe0cd58a1fed973 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2632,9 +2632,10 @@ EXPORT_SYMBOL(d_rehash); static inline unsigned start_dir_add(struct inode *dir) { + preempt_disable_rt(); for (;;) { - unsigned n = dir->i_dir_seq; - if (!(n & 1) && cmpxchg(&dir->i_dir_seq, n, n + 1) == n) + unsigned n = dir->__i_dir_seq; + if (!(n & 1) && cmpxchg(&dir->__i_dir_seq, n, n + 1) == n) return n; cpu_relax(); } @@ -2642,7 +2643,8 @@ static inline unsigned start_dir_add(struct inode *dir) static inline void end_dir_add(struct inode *dir, unsigned n) { - smp_store_release(&dir->i_dir_seq, n + 2); + smp_store_release(&dir->__i_dir_seq, n + 2); + preempt_enable_rt(); } static void d_wait_lookup(struct dentry *dentry) @@ -2678,7 +2680,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, retry: rcu_read_lock(); - seq = smp_load_acquire(&parent->d_inode->i_dir_seq); + seq = smp_load_acquire(&parent->d_inode->__i_dir_seq); r_seq = read_seqbegin(&rename_lock); dentry = __d_lookup_rcu(parent, name, &d_seq); if (unlikely(dentry)) { @@ -2706,7 +2708,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent, } hlist_bl_lock(b); - if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) { + if (unlikely(READ_ONCE(parent->d_inode->__i_dir_seq) != seq)) { hlist_bl_unlock(b); rcu_read_unlock(); goto retry; diff --git a/fs/inode.c b/fs/inode.c index ec4121f392a24a843427cbc5042cc80f272bc874..808a0c7d1c55deda66f30aae2553321eac5ce230 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -160,7 +160,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_bdev = NULL; inode->i_cdev = NULL; inode->i_link = NULL; - inode->i_dir_seq = 0; + inode->__i_dir_seq = 0; inode->i_rdev = 0; inode->dirtied_when = 0; diff --git a/include/linux/fs.h b/include/linux/fs.h index 8cba05df97105ce26816fcb189026518a3ec8d1f..fb5cd16867ec367e215381d807c69e02caca5e51 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -720,7 +720,7 @@ struct inode { struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; - unsigned i_dir_seq; + unsigned __i_dir_seq; }; __u32 i_generation; diff --git a/mm/Kconfig b/mm/Kconfig index 890a6700f76ccc690c2acaffc8e730172ec3570d..991f01daf4302117f91444ea0fae5e24b6a7db02 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -392,7 +392,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT select COMPACTION select XARRAY_MULTI help