LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Christian Kujau <lists@nerdbynature.de>, Chr <chunkeey@web.de>,
David Chinner <dgc@sgi.com>, LKML <linux-kernel@vger.kernel.org>,
xfs@oss.sgi.com, dm-devel@redhat.com, dm-crypt@saout.de,
Ritesh Raj Sarraf <rrs@researchut.com>
Subject: Re: [dm-crypt] INFO: task mount:11202 blocked for more than 120 seconds
Date: Tue, 18 Mar 2008 05:07:43 +0100 [thread overview]
Message-ID: <47DF400F.5080606@redhat.com> (raw)
In-Reply-To: <20080318005653.GA14575@gondor.apana.org.au>
Herbert Xu wrote:
> On Mon, Mar 17, 2008 at 05:36:09PM +0000, Alasdair G Kergon wrote:
>> Latest version for everyone to try:
>>
>> From: Milan Broz <mbroz@redhat.com>
>>
>> Fix regression in dm-crypt introduced in commit
>> 3a7f6c990ad04e6f576a159876c602d14d6f7fef
>> (dm crypt: use async crypto).
>>
>> If write requests need to be split into pieces, the code must not
>> process them in parallel because the crypto context cannot be shared.
>> So there can be parallel crypto operations on one part of the write,
>> but only one write bio can be processed at a time.
>
> Could you explain this part please? Crypto tfm objects are meant
> to be reentrant, synchronous or not.
Ah, sorry - I mean dm-crypt convert context (with crypto context included).
Context is reentrant in the sense of crypto operations. But we need also
sometimes split bio in writes (not only because of low memory,
but also new memory layout of cloned bio can be different and we
must not violate hardware restrictions - spec. XFS generates such
highly optimized bio requests - it's why it discovers so many dm-crypt problems ;-)
see problematic dm-crypt bio write path
while (remaining) {
clone = crypt_alloc_buffer(io, remaining);
...
io->ctx.bio_out = clone;
io->ctx.idx_out = 0;
remaining -= clone->bi_size;
...
r = crypt_convert(cc, &io->ctx);
-> fire sync or (multiple) async crypto operation
if (atomic_dec_and_test(&io->ctx.pending))
-> sync mode, submit clone direclty
...
if (unlikely(remaining))
congestion_wait(WRITE, HZ/100);
}
and in async crypto completion callback (because async callback cannot
call in its context generic_make_request directly) is called:
struct convert_context *ctx = async_req->data;
...
if (!atomic_dec_and_test(&ctx->pending))
return;
...
INIT_WORK(&io->work, kcryptd_io);
queue_work(cc->io_queue, &io->work);
...
(and from io thread later)
struct bio *clone = io->ctx.bio_out;
generic_make_request(clone);
problems:
1) we cannot use io->work struct in parallel
2) io->ctx.pending is shared here between multiple sub-bio clones
...
(there was no problems in sync crypto mode. and dm-crypt io struct is
already allocated from mempool in crypt_map allocation, so changing this
to per cloned sub-bio allocation can cause new problems in low-memory situations,
not good idea change it in this development phase...)
Milan
--
mbroz@redhat.com
next prev parent reply other threads:[~2008-03-18 4:08 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 20:32 Christian Kujau
2008-03-07 22:40 ` David Chinner
2008-03-07 23:46 ` Christian Kujau
2008-03-08 1:54 ` Christian Kujau
2008-03-09 6:15 ` 2.6.25-rc hangs (was: INFO: task mount:11202 blocked for more than 120 seconds) Christian Kujau
2008-03-09 16:44 ` 2.6.25-rc hangs Eric Sandeen
2008-03-09 18:05 ` Christian Kujau
[not found] ` <47D42AD6.10500@sandeen.net>
2008-03-09 18:49 ` Christian Kujau
2008-03-12 18:06 ` Samuel Tardieu
2008-03-12 21:02 ` Christian Kujau
2008-03-09 21:34 ` INFO: task mount:11202 blocked for more than 120 seconds David Chinner
2008-03-10 1:46 ` Christian Kujau
2008-03-12 18:03 ` Samuel Tardieu
2008-03-12 19:53 ` Chr
2008-03-12 23:07 ` Christian Kujau
2008-03-13 13:45 ` Christian Kujau
2008-03-13 21:33 ` Chr
2008-03-13 21:54 ` Christian Kujau
2008-03-14 0:15 ` Chr
2008-03-14 9:27 ` Milan Broz
2008-03-14 23:58 ` Christian Kujau
2008-03-16 20:33 ` David Chinner
2008-03-15 0:08 ` Chr
2008-03-15 13:32 ` [dm-crypt] " Chr
2008-03-15 21:34 ` Chr
2008-03-16 13:08 ` Christian Kujau
2008-03-17 17:36 ` Alasdair G Kergon
2008-03-17 18:36 ` Chr
2008-03-18 17:46 ` Christian Kujau
2008-03-18 0:56 ` Herbert Xu
2008-03-18 4:07 ` Milan Broz [this message]
2008-03-22 2:52 ` Christian Kujau
2008-03-27 8:21 ` Christian Kujau
2008-03-26 16:57 ` Chr
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=47DF400F.5080606@redhat.com \
--to=mbroz@redhat.com \
--cc=chunkeey@web.de \
--cc=dgc@sgi.com \
--cc=dm-crypt@saout.de \
--cc=dm-devel@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=lists@nerdbynature.de \
--cc=rrs@researchut.com \
--cc=xfs@oss.sgi.com \
--subject='Re: [dm-crypt] INFO: task mount:11202 blocked for more than 120 seconds' \
/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
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).