lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 10 Oct 2010 21:31:30 +0200
From:	Milan Broz <mbroz@...hat.com>
To:	Andi Kleen <andi@...stfloor.org>
CC:	Mike Snitzer <snitzer@...hat.com>, Andi Kleen <ak@...ux.intel.com>,
	device-mapper development <dm-devel@...hat.com>,
	pedrib@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [dm-devel] DM-CRYPT: Scale to multiple CPUs v3

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ