[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1275323695.3291.122.camel@edumazet-laptop>
Date: Mon, 31 May 2010 18:34:55 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: herbert@...dor.apana.org.au, dm-devel@...hat.com,
linux-kernel@...r.kernel.org, agk@...hat.com, ak@...ux.intel.com
Subject: Re: [PATCH] DM-CRYPT: Scale to multiple CPUs
Le lundi 31 mai 2010 à 18:04 +0200, Andi Kleen a écrit :
> DM-CRYPT: Scale to multiple CPUs
>
> Currently dm-crypt does all encryption work per dmcrypt mapping in a
> single workqueue. This does not scale well when multiple CPUs
> are submitting IO at a high rate. The single CPU running the single
> thread cannot keep up with the encryption and encrypted IO performance
> tanks.
>
> This patch changes the crypto workqueue to be per CPU. This means
> that as long as the IO submitter (or the interrupt target CPUs
> for reads) runs on different CPUs the encryption work will be also
> parallel.
>
> To avoid a bottleneck on the IO worker I also changed those to be
> per CPU threads.
>
> There is still some shared data, so I suspect some bouncing
> cache lines. But I haven't done a detailed study on that yet.
>
> All the threads are global, not per CPU. That is to avoid a thread
> explosion on systems with a large number of CPUs and a larger
> number of dm-crypt mappings. The code takes care to avoid problems
> with nested mappings.
>
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> /*
> + * Duplicated per cpu state. Access through
> + * per_cpu_ptr() only.
> + */
> + struct crypt_cpu *cpu;
> +
> + /*
> * Layout of each crypto request:
> *
Since commit e0fdb0e050eae331, we have a __percpu annotation so that
sparse can be augmented. This would also make the comment unnecessary...
We also have this_cpu_ accessors
> + return per_cpu_ptr(cc->cpu, smp_processor_id());
this_cpu_ptr(cc->cpu)
and __thic_cpu_ptr() for the 'raw' version
> + __get_cpu_var(io_wq_cpu) = current;
this_cpu_write(io_wq_cpu, current)
--
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