Skip to contentSkip to conversation

OneNAND: soft lockup

DISCUSSION Kyungmin Park 2 participants 3 messages Dec 28, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Actually, I'm not sure where's the right place. But if we don't touch the watchdong. it will soft lockup when mounting the JFFS2 with big partition. (I just borrowed it from nand.)

Anyway, you should not touch watchdog. You problem is fixed by adding cond_resched() at the right places. What you did - you shut up watchdog which screamed about a real error, instead of solving the error.

It looks good. and also it works well. I will commit it.

hmm, after patch, it has a problem.
How can I find the soft lockup?

/ # mount -t jffs2 /dev/mtdblock5 /tmp

BUG: soft lockup detected on CPU#0!
[<c0024e10>] (dump_stack+0x0/0x14) from [<c005d138>] (softlockup_tick+0xac/0xd8)
[<c005d08c>] (softlockup_tick+0x0/0xd8) from [<c0044bc0>] (run_local_timers+0x1)
 r7 = C022B578  r6 = 00000000  r5 = 00000000  r4 = C061FC00
[<c0044ba8>] (run_local_timers+0x0/0x1c) from [<c0044c14>] (update_process_time)
[<c0044bc4>] (update_process_times+0x0/0x7c) from [<c0024ab8>] (timer_tick+0xc8)
 r6 = C026DE20  r5 = 00000193  r4 = 00113D3F
[<c00249f0>] (timer_tick+0x0/0xe8) from [<c0035118>] (omap_32k_timer_interrupt+)
 r5 = 00000193  r4 = 00113D3F
[<c00350a4>] (omap_32k_timer_interrupt+0x0/0xe4) from [<c005d6e8>] (handle_IRQ_)
 r7 = C021E9C8  r6 = 00000025  r5 = C022A2B8  r4 = C021E9A0
[<c005d63c>] (handle_IRQ_event+0x0/0xec) from [<c005ea90>] (handle_level_irq+0x)
[<c005e9c4>] (handle_level_irq+0x0/0x134) from [<c0021714>] (asm_do_IRQ+0x48/0x)
 r7 = 00000000  r6 = C02809C8  r5 = 00000025  r4 = C021E9A0
[<c00216cc>] (asm_do_IRQ+0x0/0x60) from [<c00209f8>] (__irq_svc+0x38/0x78)
 r7 = 00000002  r6 = 00017AA9  r5 = D80FE000  r4 = FFFFFFFF
[<c00e1a44>] (jffs2_get_ino_cache+0x0/0x48) from [<c00e6f5c>] (jffs2_scan_make_)
[<c00e6f44>] (jffs2_scan_make_ino_cache+0x0/0x84) from [<c00f05e0>] (jffs2_sum_)
 r6 = 00000000  r5 = 00000000  r4 = 00017AA9
[<c00f0230>] (jffs2_sum_scan_sumnode+0x0/0x844) from [<c00e72f4>] (jffs2_scan_m)
[<c00e6fc8>] (jffs2_scan_medium+0x0/0x1144) from [<c00ea454>] (jffs2_do_mount_f)
[<c00ea2b8>] (jffs2_do_mount_fs+0x0/0x64c) from [<c00ec8f0>] (jffs2_do_fill_sup)
[<c00ec7b0>] (jffs2_do_fill_super+0x0/0x264) from [<c00ece40>] (jffs2_get_sb_mt)
 r8 = C06E57C0  r7 = 00000001  r6 = 00000000  r5 = C0737E00
 r4 = C0737C00
[<c00ecd1c>] (jffs2_get_sb_mtd+0x0/0x1a0) from [<c00ecf18>] (jffs2_get_sb_mtdnr)
[<c00ecebc>] (jffs2_get_sb_mtdnr+0x0/0x6c) from [<c00ed0ac>] (jffs2_get_sb+0x18)
 r7 = C7D47D40  r6 = 00000005  r5 = C05F0000  r4 = FFFFFFEA
[<c00ecf28>] (jffs2_get_sb+0x0/0x1c8) from [<c0083554>] (vfs_kern_mount+0x60/0x)
[<c00834f4>] (vfs_kern_mount+0x0/0xa0) from [<c00835d0>] (do_kern_mount+0x3c/0x)
 r8 = 00000000  r7 = C0230D44  r6 = C05F1000  r5 = C05F0000
 r4 = 00000000
[<c0083594>] (do_kern_mount+0x0/0x54) from [<c009997c>] (do_mount+0x5e4/0x620)
 r7 = 00000000  r6 = C7D53000  r5 = C05F0000  r4 = 00000000
[<c0099398>] (do_mount+0x0/0x620) from [<c0099d28>] (sys_mount+0xa8/0xf4)
[<c0099c80>] (sys_mount+0x0/0xf4) from [<c0020e00>] (ret_fast_syscall+0x0/0x2c)
 r7 = 00000015  r6 = 00000000  r5 = C0ED0000  r4 = 00084050

/ # cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00020000 "X-Loader + U-Boot"
mtd1: 00020000 00020000 "params"
mtd2: 00200000 00020000 "kernel"
mtd3: 01000000 00020000 "rootfs"
mtd4: 02000000 00020000 "filesystem00"
mtd5: 04dc0000 00020000 "filesystem01"

Thank you,
Kyungmin Park

#1 lore raw

Hello Kyungmin,

Quoted 2 lines · Kyungmin Park

hmm, after patch, it has a problem.
How can I find the soft lockup?

Well, it's about calling cond_resched() in JFFS2's loops. Please, try this patch.

P.S. Please, consider to use git-am (-i -s options are useful) when applying patches, in this case you will end up with correct patch author. For example, the author of this patch is incorrect at your tree:
http://git.infradead.org/?p=users/kmpark/onenand-mtd-2.6.git;a=commit;h=fd9d42f16f1d98852a386c020dcd45d8c207d10d

For example, with the attached patch you can do:

git-am -i -s reschedule-in-loops.diff

Then press e, edit the commit message, and press y. Very handy tool. Also, git-format-patch allows you to generate patches like that (with
From: and Subject: lines).

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)
#2 lore raw
Quoted 2 lines · Artem Bityutskiy

Well, it's about calling cond_resched() in JFFS2's loops. Please, try this patch.

Attached now.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)
Quoted 1 line

From 21b717500463ab32c18f81882510bec1aa05e3ae Mon Sep 17 00:00:00 2001

From: Artem Bityutskiy <[email protected]>
Date: Thu, 28 Dec 2006 12:01:41 +0200
Subject: [JFFS2] Reschedule in loops

Make JFFS2 nicer and teach it to call cond_resched() in loops which may be quite large.

---
 fs/jffs2/scan.c    |    2 ++
 fs/jffs2/summary.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
fs/jffs2/scan.c +2 -0
index ee4fc50..354ac2f 100644
@@ -138,6 +138,8 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
 	for (i=0; i<c->nr_blocks; i++) {
 		struct jffs2_eraseblock *jeb = &c->blocks[i];
 
+		cond_resched();
+
 		/* reset summary info for next eraseblock scan */
 		jffs2_sum_reset_collected(s);
 
fs/jffs2/summary.c +2 -0
index c4f7e47..2526596 100644
@@ -396,6 +396,8 @@ static int jffs2_sum_process_sum_data(struct jffs2_sb_info *c, struct jffs2_eras
 	for (i=0; i<je32_to_cpu(summary->sum_num); i++) {
 		dbg_summary("processing summary index %d\n", i);
 
+		cond_resched();
+
 		/* Make sure there's a spare ref for dirty space */
 		err = jffs2_prealloc_raw_node_refs(c, jeb, 2);
 		if (err)
Signature · 1 line
1.4.4.2