CPU hotplug issue in dm-crypt driver
On Mon, 26 Mar 2012, firstname.lastname@example.org wrote:
> We are using dm-crypt driver to encrypt Android Phone on a 2 core target.
> We saw random failures (kernel panics) in scatterwalk code when we were
> trying to bring secondary cpu online and offline randomly.
> I looked into the dm-crypt driver(drivers/md/dm-crypt.c) and put a hack in
> the kcryptd_queue_crypt function to acquire hotplug lock (using
> get_online_cpus()), just before adding new work in work queue and release
> this lock (using put_online_cpus) after completing work in kcryptd_crypt
> With this i didn't see any issue during encryption.
> So my questions are -
> 1) Is it a know problem that there is some issue with dm-crypt driver with
> cpu hotplug?
Yes it is a known problem. Not only dm-crypt is affected, there are other
kernel parts that can crash too, see:
> 2) If yes, then can someone suggest me a cleaner way to resolve this issue?
Another possible solution is to flush dm-crypt workqueues in an unplug
hook. Another possible solution is to use these patches:
--- they add paralelization to dm-crypt and as a side effect, they remove
the dm-crypt bug. You can actually use only the first five patches:
But, as a general solution, I'd recommend to not use CPU unplug at all.
There are other kernel parts that have the same bug as dm-crypt and it is
not trivial to find them.
> Thanks in advance!
> Sent by an employee of the Qualcomm Innovation Center, Inc.
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
> dm-devel mailing list
dm-devel mailing list