Added BFQ IO Scheduler
/fs/ioprio.c
blob:c7c0b28d7d2177c7c88d32f3f62856e97cfc7ff5 -> blob:4962f0ea0e703779eaaea8c80e80c5e4eb5bcd6f
--- fs/ioprio.c
+++ fs/ioprio.c
@@ -29,7 +29,7 @@
int set_task_ioprio(struct task_struct *task, int ioprio)
{
- int err;
+ int err, i;
struct io_context *ioc;
const struct cred *cred = current_cred(), *tcred;
@@ -59,12 +59,17 @@ int set_task_ioprio(struct task_struct *
err = -ENOMEM;
break;
}
+ /* let other ioc users see the new values */
+ smp_wmb();
task->io_context = ioc;
} while (1);
if (!err) {
ioc->ioprio = ioprio;
- ioc->ioprio_changed = 1;
+ /* make sure schedulers see the new ioprio value */
+ wmb();
+ for (i = 0; i < IOC_IOPRIO_CHANGED_BITS; i++)
+ set_bit(i, ioc->ioprio_changed);
}
task_unlock(task);