From: FabF <Fabian.Frederick@skynet.be>
To: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 2.6.6-rc3] as-io isolation ?
Date: Wed, 28 Apr 2004 22:24:21 +0200 [thread overview]
Message-ID: <1083183861.4618.13.camel@bluerhyme.real3> (raw)
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
Hi,
Here's a patch _idea_ to isolate anticipatory I/O from normal I/O
scheduler process by adding a specific put io context method so that
ll_rw_blk stuff could be as-iosched transparent.I guess we could point
as iosched exit instead of exit_io_context as well ...
Regards,
FabF
[-- Attachment #2: asiocontext1.diff --]
[-- Type: text/x-patch, Size: 2485 bytes --]
diff -Naur orig/drivers/block/as-iosched.c edited/drivers/block/as-iosched.c
--- orig/drivers/block/as-iosched.c 2004-04-04 05:36:13.000000000 +0200
+++ edited/drivers/block/as-iosched.c 2004-04-28 22:05:21.000000000 +0200
@@ -222,6 +222,16 @@
return ret;
}
+void as_put_io_context(struct io_context *ioc)
+{
+ if (ioc == NULL)
+ return;
+ if (ioc->aic && ioc->aic->dtor)
+ ioc->aic->dtor(ioc->aic);
+ put_io_context(ioc);
+
+}
+
/*
* If the current task has no AS IO context then create one and initialise it.
* Then take a ref on the task's io context and return it.
@@ -231,10 +241,8 @@
struct io_context *ioc = get_io_context(GFP_ATOMIC);
if (ioc && !ioc->aic) {
ioc->aic = alloc_as_io_context();
- if (!ioc->aic) {
- put_io_context(ioc);
- ioc = NULL;
- }
+ if (!ioc->aic)
+ as_put_io_context(ioc);
}
return ioc;
}
@@ -1015,7 +1023,7 @@
}
}
- put_io_context(arq->io_context);
+ as_put_io_context(arq->io_context);
out:
arq->state = AS_RQ_POSTSCHED;
}
@@ -1183,10 +1191,8 @@
/* In case we have to anticipate after this */
copy_io_context(&ad->io_context, &arq->io_context);
} else {
- if (ad->io_context) {
- put_io_context(ad->io_context);
- ad->io_context = NULL;
- }
+ if (ad->io_context)
+ as_put_io_context(ad->io_context);
if (ad->current_write_count != 0)
ad->current_write_count--;
@@ -1837,7 +1843,7 @@
BUG_ON(!list_empty(&ad->fifo_list[REQ_ASYNC]));
mempool_destroy(ad->arq_pool);
- put_io_context(ad->io_context);
+ as_put_io_context(ad->io_context);
kfree(ad->hash);
kfree(ad);
}
diff -Naur orig/drivers/block/ll_rw_blk.c edited/drivers/block/ll_rw_blk.c
--- orig/drivers/block/ll_rw_blk.c 2004-04-28 19:13:23.000000000 +0200
+++ edited/drivers/block/ll_rw_blk.c 2004-04-28 22:06:35.000000000 +0200
@@ -2844,13 +2844,12 @@
BUG_ON(atomic_read(&ioc->refcount) == 0);
if (atomic_dec_and_test(&ioc->refcount)) {
- if (ioc->aic && ioc->aic->dtor)
- ioc->aic->dtor(ioc->aic);
kfree(ioc);
+ ioc=NULL;
}
}
-/* Called by the exitting task */
+/* Called by the exiting task */
void exit_io_context(void)
{
unsigned long flags;
@@ -2859,10 +2858,10 @@
local_irq_save(flags);
ioc = current->io_context;
if (ioc) {
- if (ioc->aic && ioc->aic->exit)
+ if (ioc->aic && ioc->aic->exit){
ioc->aic->exit(ioc->aic);
- put_io_context(ioc);
- current->io_context = NULL;
+ as_put_io_context(ioc);
+ }
} else
WARN_ON(1);
local_irq_restore(flags);
next reply other threads:[~2004-04-28 20:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-28 20:24 FabF [this message]
2004-04-29 0:39 ` Nick Piggin
2004-04-29 15:38 ` FabF
2004-04-30 12:18 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1083183861.4618.13.camel@bluerhyme.real3 \
--to=fabian.frederick@skynet.be \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®