From: Matthew Wilcox <willy@debian.org>
To: Suparna Bhattacharya <suparna@in.ibm.com>
Cc: bcrl@redhat.com, akpm@digeo.com, linux-kernel@vger.kernel.org,
linux-aio@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: Filesystem AIO read-write patches
Date: Thu, 24 Apr 2003 13:48:16 +0100 [thread overview]
Message-ID: <20030424124816.GX3140@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20030424104103.C2288@in.ibm.com>
On Thu, Apr 24, 2003 at 10:41:03AM +0530, Suparna Bhattacharya wrote:
> -void blk_congestion_wait(int rw, long timeout)
> +int blk_congestion_wait_wq(int rw, long timeout, wait_queue_t *wait)
> {
> - DEFINE_WAIT(wait);
> wait_queue_head_t *wqh = &congestion_wqh[rw];
> + DEFINE_WAIT(local_wait);
> +
> + if (!wait)
> + wait = &local_wait;
>
> blk_run_queues();
> - prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE);
> + prepare_to_wait(wqh, wait, TASK_UNINTERRUPTIBLE);
> + if (!is_sync_wait(wait))
> + return -EIOCBRETRY;
> +
> io_schedule_timeout(timeout);
> - finish_wait(wqh, &wait);
> + finish_wait(wqh, wait);
> + return 0;
> +}
> +
> +void blk_congestion_wait(int rw, long timeout)
> +{
> + blk_congestion_wait_wq(rw, timeout, NULL);
> }
I don't like this one. DEFINE_WAIT allocates stuff on the stack.
And aio seems to allocate a lot more on the stack than normal io does.
How about the following instead:
int blk_congestion_wait_wq(int rw, long timeout, wait_queue_t *wait)
{
wait_queue_head_t *wqh = &congestion_wqh[rw];
blk_run_queues();
prepare_to_wait(wqh, wait, TASK_UNINTERRUPTIBLE);
if (!is_sync_wait(wait))
return -EIOCBRETRY;
io_schedule_timeout(timeout);
finish_wait(wqh, wait);
return 0;
}
void blk_congestion_wait(int rw, long timeout)
{
DEFINE_WAIT(wait);
blk_congestion_wait_wq(rw, timeout, &wait);
}
--
"It's not Hollywood. War is real, war is primarily not about defeat or
victory, it is about death. I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
next prev parent reply other threads:[~2003-04-24 12:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-24 4:52 Filesystem AIO read-write patches Suparna Bhattacharya
2003-04-24 5:00 ` [PATCH 1/7] Filesystem AIO rdwr - aio retry core changes Suparna Bhattacharya
2003-04-24 5:04 ` [PATCH 2/7] Filesystem AIO rdwr - aio read Suparna Bhattacharya
2003-04-24 5:11 ` Filesystem AIO read-write patches Suparna Bhattacharya
2003-04-24 12:48 ` Matthew Wilcox [this message]
2003-04-24 5:16 ` [PATCH 4/7] Filesystem AIO rdwr - async down (x86) Suparna Bhattacharya
2003-04-24 5:19 ` [5/7] Filesystem AIO rdwr - use down_wq for aio write Suparna Bhattacharya
2003-04-24 5:21 ` [PATCH 6/7] Filesystem AIO rdwr - async bread Suparna Bhattacharya
2003-04-24 5:28 ` [PATCH 7/7] Filesystem AIO rdwr: async get block for ext2 Suparna Bhattacharya
2003-04-24 13:13 ` Filesystem AIO read-write patches Benjamin LaHaise
2003-04-24 14:27 ` Suparna Bhattacharya
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=20030424124816.GX3140@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=akpm@digeo.com \
--cc=bcrl@redhat.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suparna@in.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).