FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-26-2012, 07:28 PM
 
Default CPU hotplug issue in dm-crypt driver

Hi,

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
function.
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?

2) If yes, then can someone suggest me a cleaner way to resolve this issue?

Thanks in advance!

--Shashank

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@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-27-2012, 12:51 PM
Milan Broz
 
Default CPU hotplug issue in dm-crypt driver

On 03/26/2012 09:28 PM, mittals@codeaurora.org wrote:

1) Is it a know problem that there is some issue with dm-crypt driver with
cpu hotplug?


It is quite possible that there is a bug on CPU hotplugging.

Can you please sent your patch/workaround and how you can reproduce it?

(The code in dmcrypt will change in future. Anyway Mikulas already
had some complaints here regarding CPU hotplug, adding him to cc.)

Milan

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-27-2012, 07:24 PM
Mikulas Patocka
 
Default CPU hotplug issue in dm-crypt driver

Hi

On Mon, 26 Mar 2012, mittals@codeaurora.org wrote:

> Hi,
>
> 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
> function.
> 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:
http://www.redhat.com/archives/dm-devel/2012-March/msg00035.html

> 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:
http://people.redhat.com/mpatocka/patches/kernel/dm-crypt-paralelizace/current/
--- 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:
dm-crypt-fix-mempool-deadlock.patch, dm-crypt-test-error.patch,
dm-crypt-rename-pending.patch, dm-crypt-global-static-cipher-data.patch,
dm-crypt-remove-percpu.patch.

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.

Mikulas

> Thanks in advance!
>
> --Shashank
>
> 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@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 03:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org