diff options
author | Arianna Avanzini <avanzini.arianna@gmail.com> | 2011-09-12 22:40:31 +0200 |
---|---|---|
committer | KalimochoAz <calimochoazucarado@gmail.com> | 2012-10-15 14:04:02 +0200 |
commit | 4aa8b63a3d032d221b9d4dcfcd4f8695244498b7 (patch) | |
tree | f4f44967654d6b67d5f872bee844e3c9b9c44f75 /fs/ioprio.c | |
parent | bb49aa0eff908165d6de36033ed48ff3144e2d8c (diff) | |
download | kernel_samsung_crespo-4aa8b63a3d032d221b9d4dcfcd4f8695244498b7.zip kernel_samsung_crespo-4aa8b63a3d032d221b9d4dcfcd4f8695244498b7.tar.gz kernel_samsung_crespo-4aa8b63a3d032d221b9d4dcfcd4f8695244498b7.tar.bz2 |
block: prepare I/O context code for BFQ-v5 for 3.0
BFQ uses struct cfq_io_context to store its per-process per-device data,
reusing the same code for cic handling of CFQ. The code is not shared
ATM to minimize the impact of these patches.
This patch introduces a new hlist to each io_context to store all the
cic's allocated by BFQ to allow calling the right destructor on module
unload; the radix tree used for cic lookup needs to be duplicated
because it can contain dead keys inserted by a scheduler and later
retrieved by the other one.
Update the io_context exit and free paths to take care also of
the BFQ cic's.
Change the type of cfqq inside struct cfq_io_context to void *
to use it also for BFQ per-queue data.
A new bfq-specific ioprio_changed field is necessary, too, to avoid
clobbering cfq's one, so switch ioprio_changed to a bitmap, with one
element per scheduler.
Signed-off-by: Fabio Checconi <fabio@gandalf.sssup.it>
Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: KalimochoAz <calimochoazucarado@gmail.com>
Diffstat (limited to 'fs/ioprio.c')
-rw-r--r-- | fs/ioprio.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c index 7da2a06..95a6c2b 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c @@ -30,7 +30,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; @@ -60,12 +60,17 @@ int set_task_ioprio(struct task_struct *task, int ioprio) 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); |