| From d1f7b1468342aaa0b28123a04a329e0e77ad0311 Mon Sep 17 00:00:00 2001 |
| From: Ingo Molnar <mingo@elte.hu> |
| 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 <mingo@elte.hu> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/block/blk-core.c b/block/blk-core.c |
| index d1a9a0a..f776d0e 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 953173a..116fd33 100644 |
| --- a/fs/dcache.c |
| +++ b/fs/dcache.c |
| @@ -727,8 +727,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 cce6bbd..9192f7e 100644 |
| --- a/fs/exec.c |
| +++ b/fs/exec.c |
| @@ -55,6 +55,7 @@ |
| #include <linux/fsnotify.h> |
| #include <linux/fs_struct.h> |
| #include <linux/pipe_fs_i.h> |
| +#include <linux/delay.h> |
| |
| #include <asm/uaccess.h> |
| #include <asm/mmu_context.h> |
| @@ -734,10 +735,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 87e1290..b08281f 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 f277c4a..da4409e 100644 |
| --- a/fs/proc/task_mmu.c |
| +++ b/fs/proc/task_mmu.c |
| @@ -138,8 +138,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.1.1 |
| |