From: Jeff Moyer <jmoyer@redhat.com>
To: Richard Kralovic <Richard.Kralovic@dcs.fmph.uniba.sk>
Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk
Subject: Re: CFQ and dm-crypt
Date: Thu, 04 Nov 2010 17:07:02 -0400 [thread overview]
Message-ID: <x49tyjwajd5.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <4CD185C2.8000006@dcs.fmph.uniba.sk> (Richard Kralovic's message of "Wed, 03 Nov 2010 16:54:42 +0100")
Richard Kralovic <Richard.Kralovic@dcs.fmph.uniba.sk> writes:
> On 11/03/10 04:23, Jeff Moyer wrote:
>>> > CFQ io scheduler relies on using task_struct current to determine which
>>> > process makes the io request. On the other hand, some dm modules (such
>>> > as dm-crypt) use separate threads for doing io. As CFQ sees only these
>>> > threads, it provides a very poor performance in such a case.
>>> >
>>> > IMHO the correct solution for this would be to store, for every io
>>> > request, the process that initiated it (and preserve this information
>>> > while the request is processed by device mapper). Would that be feasible?
>> Sure. Try the attached patch (still an rfc) and let us know how it
>> goes. In my environment, it speed up multiple concurrent buffered
>> readers. I wasn't able to do a full analysis via blktrace as 2.6.37-rc1
>> seems to have broken blktrace support on my system.
>
> Thanks for the patch. Unfortunately, I got a kernel panic quite soon
> after booting the patched kernel. I was not able to reproduce the
> panic in a virtual machine, so I had to manually note the backtrace,
> thus I apologize that it's incomplete:
>
> Fatal exception in interupt.
> ...
> do_invalid_op
> cic_free_func 0x9d/0xb0
> bio_endio 0x42/0x70
> task_rq_lock
> try_to_wake_up
> invalid_op
> cic_free_func
> cfq_free_io_context
> put_io_context
> cfq_put_request
> ...
Hmm, clearly a reference counting issue. I can't reproduce it, but I'll
keep staring and trying.
> When I combined the patch with my previous hack on dm-crypt, it worked
> fine; so the problem apparently goes away if cfq sees the corret io
> context.
OK, good to know, thanks for the info.
> Moreover, I noticed in the sources that cfq still uses current task on
> many places. For example, the CPU scheduler settings are inherited if
> there is no io priority set. Hence I was wondering if it does not make
> more sense to store whole task_struct of the initiating process in
> bio, instead of just io_context?
It's actually not that many. elv_may_queue should also get passed the
io_context (and I've since fixed that in my local version). The cgroup
code may actually require the task; I'm waiting to hear back from Vivek
to see if there's a way to get from io_context to cgroup. As for the io
priority, it may be that we can set that in the io_context as well. I'm
not completely sure I agree with linking a task struct into a bio. It
may make the exit path a bit tricky. I'll think more about it if it
comes to that.
Thanks for the testing and the thoughtful comments. I'll let you know
when I have another patch for testing (though I'm at the Linux Plumbers
Conference, so I'm not sure how much time I'll have to dedicate to the
task this week).
Cheers,
Jeff
next prev parent reply other threads:[~2010-11-04 21:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-24 13:51 Richard Kralovic
2010-10-24 16:15 ` Milan Broz
2010-10-25 9:53 ` Richard Kralovic
2010-10-25 11:09 ` Milan Broz
2010-10-25 14:22 ` Jeff Moyer
2010-10-25 20:59 ` Vivek Goyal
2010-10-26 8:37 ` Richard Kralovic
2010-10-26 10:57 ` Vivek Goyal
2010-11-03 3:23 ` Jeff Moyer
2010-11-03 15:54 ` Richard Kralovic
2010-11-04 21:07 ` Jeff Moyer [this message]
2010-11-16 16:44 ` Jeff Moyer
2010-11-21 20:16 ` Richard Kralovic
2010-11-22 14:20 ` Jeff Moyer
2010-11-22 21:01 ` Richard Kralovic
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=x49tyjwajd5.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=Richard.Kralovic@dcs.fmph.uniba.sk \
--cc=axboe@kernel.dk \
--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®