Errors with Lemote's 3.5.0 kernels for Loongson3A

30 views
Skip to first unread message

David Kuehling

unread,
May 17, 2014, 12:38:26 AM5/17/14
to loongs...@googlegroups.com
Hi,

running a Xinghuo "Spark" 3A 6100 [4] from an encrypted root filesystem
(dm_crypt+lvm), with kernels 3.5.0-8 and 3.5.0-9 [1] I get plenty of
these error messages in the kernel log when doing I/O:

[ 933.398437] BUG: using smp_processor_id() in preemptible [00000000] code: kworker/2:2/2763
[ 933.398437] caller is crypt_convert+0x80/0x438 [dm_crypt]
[ 933.398437] Call Trace:
[ 933.398437] [<ffffffff80719990>] dump_stack+0x8/0x34
[ 933.398437] [<ffffffff804753bc>] debug_smp_processor_id+0xcc/0xf0
[ 933.398437] [<ffffffffc00b6bf4>] crypt_convert+0x80/0x438 [dm_crypt]
[ 933.398437] [<ffffffffc00b7090>] kcryptd_crypt+0xe4/0x524 [dm_crypt]
[ 933.398437] [<ffffffff802499b8>] process_one_work+0x290/0x4dc
[ 933.398437] [<ffffffff8024a100>] worker_thread+0x2b4/0x404
[ 933.398437] [<ffffffff8024e9c0>] kthread+0x88/0x90
[ 933.398437] [<ffffffff8020651c>] kernel_thread_helper+0x10/0x18

I also recently encountered one system freeze directly after starting an
I/O intensive operation (tar -xIvf on a kernel source), which may be
related (this freeze occured with 3.5.0-8).

Maybe these errors can be worked around by setting
CONFIG_CRYPTO_WORKQUEUE=n? Kernel config and debian packages containing
my kernel can be found here [2,3].

cheers,

David

[1] http://dev.lemote.com/cgit/linux-official.git
[2] http://sourceforge.net/projects/loongson-stuff/files/loongson3a/
[3] http://sourceforge.net/p/loongson-stuff/code/ci/master/tree/
[4] http://www.lemote.com/products/computer/fulong/348.html
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg
Fingerprint: B63B 6AF2 4EEB F033 46F7 7F1D 935E 6F08 E457 205F

David Kuehling

unread,
May 17, 2014, 9:44:53 PM5/17/14
to loongs...@googlegroups.com
>>>>> "David" == David Kuehling <dvdk...@posteo.de> writes:

> running a Xinghuo "Spark" 3A 6100 [4] from an encrypted root
> filesystem (dm_crypt+lvm), with kernels 3.5.0-8 and 3.5.0-9 [1] I get
> plenty of these error messages in the kernel log when doing I/O:
>
> [ 933.398437] BUG: using smp_processor_id() in preemptible [00000000]
> code:
[..]
> Maybe these errors can be worked around by setting
> CONFIG_CRYPTO_WORKQUEUE=n? Kernel config and debian packages
> containing my kernel can be found here [2,3].

This kind of workaround seems to be impossible. CONFIG_CRYPTO_BLKCIPHER
depends on CONFIG_CRYPTO_WORKQUEUE. Then let's just hope these error
messages sound more severe than they actually are :/

David

David Kuehling

unread,
May 17, 2014, 11:11:09 PM5/17/14
to loongs...@googlegroups.com, Huacai Chen
>>>>> "David" == David Kuehling <dvdk...@posteo.de> writes:

> running a Xinghuo "Spark" 3A 6100 [4] from an encrypted root
> filesystem (dm_crypt+lvm), with kernels 3.5.0-8 and 3.5.0-9 [1] I get
> plenty of these error messages in the kernel log when doing I/O:

> [ 933.398437] BUG: using smp_processor_id() in preemptible [00000000]
> code: kworker/2:2/2763

These errors go away when I use a kernel compiled with
CONFIG_LOONGSON3_CPUAUTOPLUG disabled. This may point to the error
being logged by use of smp_processor_id() in do_autoplug_timer().

Unfortunately without cpu autoplugging my system consumes about 8 W more
when idle (or 1.50 € in electricity per months when running 24/7). I
wonder whether these error messages can be savely ignored?

David

Huacai Chen

unread,
May 18, 2014, 10:34:43 AM5/18/14
to David Kuehling, loongs...@googlegroups.com
If it is really autoplug's bug, why the message reports error in
crypt_convert()? I'm confusing.

David Kuehling

unread,
May 18, 2014, 12:18:23 PM5/18/14
to loongs...@googlegroups.com
>>>>> "Huacai" == Huacai Chen <chenh...@gmail.com> writes:

> If it is really autoplug's bug, why the message reports error in
> crypt_convert()? I'm confusing.

I'm somewhat confused, too, but looking at he code, there is not a
single call to smp_processor_id() in crypt_convert(). Then
do_autoplug_timer() runs from some kind of timer
(INIT_DELAYED_WORK_DEFERRABLE), and I assumed that it may run on top of
the stack of crypt_convert, interrupting crypt_convert like an IRQ.

When doing I/O intensive stuff on an encrypted partition, a _lot_ of
time is spent in crypt_convert, so statistically speaking a timer would
have a high probability of interrupting crypt_convert() and not any
other function.

However, I don't know nothing about the linux kernel, never having done
any serious kernel programming, so this is second-guessing at best.

Huacai Chen

unread,
May 19, 2014, 3:34:28 AM5/19/14
to loongs...@googlegroups.com
You can try to remove this line in
arch/mips/loongson/loongson-3/loongson3_cpuautoplug.c

BUG_ON(smp_processor_id() != 0);

Huacai

David Kuehling

unread,
May 21, 2014, 12:40:00 AM5/21/14
to loongs...@googlegroups.com, Huacai Chen
>>>>> "Huacai" == Huacai Chen <chenh...@gmail.com> writes:

> You can try to remove this line in
> arch/mips/loongson/loongson-3/loongson3_cpuautoplug.c

> BUG_ON(smp_processor_id() != 0);

Just removed that line, recompiled, and the kernel log still shows the
BUG: messages

[ 458.898437] BUG: using smp_processor_id() in preemptible [00000000] code: kworker/2:2/248
[ 458.898437] caller is crypt_convert+0x80/0x438 [dm_crypt]
[ 458.898437] Call Trace:
[ 458.898437] [<ffffffff80719990>] dump_stack+0x8/0x34
[ 458.898437] [<ffffffff804753bc>] debug_smp_processor_id+0xcc/0xf0
[ 458.898437] [<ffffffffc00b6bf4>] crypt_convert+0x80/0x438 [dm_crypt]
[ 458.898437] [<ffffffffc00b7090>] kcryptd_crypt+0xe4/0x524 [dm_crypt]
[ 458.898437] [<ffffffff802499b8>] process_one_work+0x290/0x4dc
[ 458.898437] [<ffffffff8024a100>] worker_thread+0x2b4/0x404
[ 458.898437] [<ffffffff8024e9c0>] kthread+0x88/0x90
[ 458.898437] [<ffffffff8020651c>] kernel_thread_helper+0x10/0x18

So yes you're right it's not directly related to autoplug. However with
autoplug disabled, these errors still seem to vanish. Will need to run
a few more tests to be sure.
Reply all
Reply to author
Forward
0 new messages