From: Christoph Hellwig <hch@infradead.org>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, linux-kernel@vger.kernel.org
Subject: Re: Preempt & smp_processor_id in __make_request
Date: Tue, 26 Jul 2011 07:43:30 -0400 [thread overview]
Message-ID: <20110726114330.GA12704@infradead.org> (raw)
In-Reply-To: <1311672726.2700.5.camel@menhir>
On Tue, Jul 26, 2011 at 10:32:06AM +0100, Steven Whitehouse wrote:
> diff --git a/block/blk-core.c b/block/blk-core.c
> index f8cb099..f925581 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -1283,7 +1283,7 @@ get_rq:
>
> if (test_bit(QUEUE_FLAG_SAME_COMP, &q->queue_flags) ||
> bio_flagged(bio, BIO_CPU_AFFINE))
> - req->cpu = smp_processor_id();
> + req->cpu = raw_smp_processor_id();
>
> plug = current->plug;
> if (plug) {
>
> However this fixes the symptoms, rather than the cause, so I'm not at
> all sure that this is the correct solution,
It doesn't fix the symptoms - the warning is one of those 98% percent
right types of warnings. In this case get_cpu/put_cpu doesn't buy you
anthing - we want to stash away the cpu id that we submitted the I/O
from, to compare it when we later process the I/O completion from
a different context. With some PREEMPT options we might actually get
rescheduled to a different CPU during the rest of this function, but
as we submit the plugged requests at this point we'll still be correct.
Even if wasn't we would already thrash the cache badly enough for this
optimization not to matter in that case.
next prev parent reply other threads:[~2011-07-26 11:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-26 9:32 Preempt & smp_processor_id in __make_request Steven Whitehouse
2011-07-26 10:56 ` Sergey Senozhatsky
2011-07-26 16:15 ` Williams, Dan J
2011-07-26 11:43 ` Christoph Hellwig [this message]
2011-07-26 13:05 ` 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=20110726114330.GA12704@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=swhiteho@redhat.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