All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Mike Snitzer <snitzer@redhat.com>,
	Andi Kleen <ak@linux.intel.com>,
	device-mapper development <dm-devel@redhat.com>,
	pedrib@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3
Date: Sun, 10 Oct 2010 21:31:30 +0200	[thread overview]
Message-ID: <4CB21492.8050101@redhat.com> (raw)
In-Reply-To: <20101010191640.GC21681@basil.fritz.box>

On 10/10/2010 09:16 PM, Andi Kleen wrote:
>> Not if in_interrupt is set though?
>> +       if (per_cpu(io_wq_cpu, cpu) == current && !in_interrupt()) {
>>
>> What I am missing here?
> 
> The interrupt doesn't block on the task.
> 
> Actually most likely that check isn't needed anyways because
> that should not happen, was just pure paranoia from my side.

I don't think so. If you run crypto in async mode, you get asynchronous
callback (kcryptd_asynnc_done() here).

AFAIK this callback is called in interrupt context. This callback
decreases pending counter and if it reach zero it calls
kcryptd_crypt_write_io_submit() -> kcryptd_queue_io().

You cannot call direct encryption if it is called from async callback,
so the IO must be always queued to IO workqueue for later.

So the in_interrupt() is IMHO equivalent of async flag and it is
properly placed there.

But previously, there were threads per device, so if one IO thread blocks,
others stacked mappings can continue
Now I see possibility for deadlock there because we have one io thread now
(assuming that 1 CPU situation Alasdair mentioned).

Or is there a mistake in my analysis?

> 
>>
>> (And assume there is only 1 CPU too for worst case behaviour, presumably.)
> 
> One per process, previously it was always one per CPU.

Nope, one singlethread per crypt device (resp. two: io + crypt).

Milan

  reply	other threads:[~2010-10-10 19:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-10 11:59 [PATCH] DM-CRYPT: Scale to multiple CPUs v3 Andi Kleen
2010-10-10 12:38 ` [dm-devel] " Milan Broz
2010-10-10 12:53   ` Milan Broz
2010-10-10 13:09     ` Andi Kleen
2010-10-10 13:08   ` Andi Kleen
2010-10-10 15:34     ` Milan Broz
2010-10-10 16:06       ` Andi Kleen
2010-10-10 16:22       ` Mike Snitzer
2010-10-10 16:41         ` Milan Broz
2010-10-10 17:07           ` Mike Snitzer
2010-10-10 18:56             ` [PATCH] Fix double free and use generic private pointer in per-cpu struct Milan Broz
2010-10-14 19:26               ` [dm-devel] " Milan Broz
2010-10-20 14:20                 ` [dm-devel] [PATCH] DM-CRYPT: Scale to multiple CPUs v3 Milan Broz
2010-10-20 17:32                   ` Alasdair G Kergon
2010-10-10 17:01         ` Alasdair G Kergon
2010-10-10 17:44           ` Andi Kleen
2010-10-10 17:44             ` Andi Kleen
2010-10-10 18:17             ` [dm-devel] " Alasdair G Kergon
2010-10-10 18:48               ` Alasdair G Kergon
2010-10-10 18:48                 ` [dm-devel] " Alasdair G Kergon
2010-10-10 18:51               ` Andi Kleen
2010-10-10 18:51                 ` Andi Kleen
2010-10-10 19:07                 ` Alasdair G Kergon
2010-10-10 19:16                   ` Andi Kleen
2010-10-10 19:16                     ` Andi Kleen
2010-10-10 19:31                     ` Milan Broz [this message]
2010-10-10 20:20                       ` Andi Kleen
2010-10-11  9:32                         ` Milan Broz

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=4CB21492.8050101@redhat.com \
    --to=mbroz@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pedrib@gmail.com \
    --cc=snitzer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.