From b085b0e0b5ef212aef0ef3b5851d0676a12f804d Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:12 -0500 Subject: [PATCH] fs/block: preempt-rt support commit e97977e5171636cba43ae9d30f00cb82e175511b in tip. Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- block/blk-core.c | 6 +++--- fs/dcache.c | 5 +++-- fs/exec.c | 5 ++++- fs/file.c | 5 +++-- fs/pipe.c | 12 ++++++++++++ fs/proc/task_mmu.c | 4 +++- 6 files changed, 28 insertions(+), 9 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 9fe174d..f33d074 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -202,7 +202,7 @@ EXPORT_SYMBOL(blk_dump_rq_flags); */ void blk_plug_device(struct request_queue *q) { - WARN_ON(!irqs_disabled()); + WARN_ON_NONRT(!irqs_disabled()); /* * don't plug a stopped queue, it must be paired with blk_start_queue() @@ -242,7 +242,7 @@ EXPORT_SYMBOL(blk_plug_device_unlocked); */ int blk_remove_plug(struct request_queue *q) { - WARN_ON(!irqs_disabled()); + WARN_ON_NONRT(!irqs_disabled()); if (!queue_flag_test_and_clear(QUEUE_FLAG_PLUGGED, q)) return 0; @@ -334,7 +334,7 @@ EXPORT_SYMBOL(blk_unplug); **/ void blk_start_queue(struct request_queue *q) { - WARN_ON(!irqs_disabled()); + WARN_ON_NONRT(!irqs_disabled()); queue_flag_clear(QUEUE_FLAG_STOPPED, q); __blk_run_queue(q); diff --git a/fs/dcache.c b/fs/dcache.c index f1358e5..d74e93c 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -733,8 +733,9 @@ void shrink_dcache_for_umount(struct super_block *sb) { struct dentry *dentry; - if (down_read_trylock(&sb->s_umount)) - BUG(); +// -rt: this might succeed there ... +// if (down_read_trylock(&sb->s_umount)) +// BUG(); dentry = sb->s_root; sb->s_root = NULL; diff --git a/fs/exec.c b/fs/exec.c index e6e94c6..7c75fe6 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -735,10 +736,12 @@ static int exec_mmap(struct mm_struct *mm) } } task_lock(tsk); + local_irq_disable(); active_mm = tsk->active_mm; + activate_mm(active_mm, mm); tsk->mm = mm; tsk->active_mm = mm; - activate_mm(active_mm, mm); + local_irq_enable(); task_unlock(tsk); arch_pick_mmap_layout(mm); if (old_mm) { diff --git a/fs/file.c b/fs/file.c index 34bb7f7..b35c2d2 100644 --- a/fs/file.c +++ b/fs/file.c @@ -103,14 +103,15 @@ void free_fdtable_rcu(struct rcu_head *rcu) kfree(fdt->open_fds); kfree(fdt); } else { - fddef = &get_cpu_var(fdtable_defer_list); + + fddef = &per_cpu(fdtable_defer_list, raw_smp_processor_id()); + spin_lock(&fddef->lock); fdt->next = fddef->next; fddef->next = fdt; /* vmallocs are handled from the workqueue context */ schedule_work(&fddef->wq); spin_unlock(&fddef->lock); - put_cpu_var(fdtable_defer_list); } } diff --git a/fs/pipe.c b/fs/pipe.c index 37ba29f..a9dcf21 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -434,8 +434,14 @@ redo: wake_up_interruptible_sync(&pipe->wait); kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); } + /* + * Hack: we turn off atime updates for -RT kernels. + * Who uses them on pipes anyway? + */ +#ifndef CONFIG_PREEMPT_RT if (ret > 0) file_accessed(filp); +#endif return ret; } @@ -607,8 +613,14 @@ out: wake_up_interruptible_sync(&pipe->wait); kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); } + /* + * Hack: we turn off atime updates for -RT kernels. + * Who uses them on pipes anyway? + */ +#ifndef CONFIG_PREEMPT_RT if (ret > 0) file_update_time(filp); +#endif return ret; } diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 47f5b14..444ec32 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -142,8 +142,10 @@ static void *m_start(struct seq_file *m, loff_t *pos) vma = NULL; if ((unsigned long)l < mm->map_count) { vma = mm->mmap; - while (l-- && vma) + while (l-- && vma) { vma = vma->vm_next; + cond_resched(); + } goto out; } -- 1.7.0.4