Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Milan Broz
Date: Sunday, October 10, 2010 - 12:31 pm

On 10/10/2010 09:16 PM, Andi Kleen wrote:

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?


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

Milan
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] DM-CRYPT: Scale to multiple CPUs v3, Andi Kleen, (Sun Oct 10, 4:59 am)
Re: DM-CRYPT: Scale to multiple CPUs v3, Mike Snitzer, (Sun Oct 10, 9:22 am)
Re: DM-CRYPT: Scale to multiple CPUs v3, Milan Broz, (Sun Oct 10, 9:41 am)
Re: DM-CRYPT: Scale to multiple CPUs v3, Alasdair G Kergon, (Sun Oct 10, 10:01 am)
Re: DM-CRYPT: Scale to multiple CPUs v3, Mike Snitzer, (Sun Oct 10, 10:07 am)
Re: DM-CRYPT: Scale to multiple CPUs v3, Andi Kleen, (Sun Oct 10, 10:44 am)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Alasdair G Kergon, (Sun Oct 10, 11:17 am)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Alasdair G Kergon, (Sun Oct 10, 11:48 am)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Andi Kleen, (Sun Oct 10, 11:51 am)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Alasdair G Kergon, (Sun Oct 10, 12:07 pm)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Andi Kleen, (Sun Oct 10, 12:16 pm)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Milan Broz, (Sun Oct 10, 12:31 pm)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Andi Kleen, (Sun Oct 10, 1:20 pm)
Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3, Milan Broz, (Mon Oct 11, 2:32 am)
Re: [dm-devel] [PATCH] DM-CRYPT: Scale to multiple CPUs v3, Alasdair G Kergon, (Wed Oct 20, 10:32 am)