Chinaunix首页 | 论坛 | 博客
  • 博客访问: 86734
  • 博文数量: 14
  • 博客积分: 1708
  • 博客等级: 上尉
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2008-01-27 09:29
文章分类

全部博文(14)

文章存档

2011年(1)

2010年(13)

分类:

2010-07-05 10:22:34

前几天遇到启动CGL PowerPC P4080时遇到一些call trace输出,但不影响启动:
------
......
Mount-cache hash table entries: 512
mpic: requesting IPIs...
BUG: swapper:0 task might have lost a preemption check!
------------[ cut here ]------------
Badness
at kernel/sched.c:3652
NIP: c00247f4 LR: c00247f4 CTR: c001c7c4
REGS: c0623eb0 TRAP: 0700 Not tainted (2.6.34-grsec-WR4.0.0.0_cgl)
MSR: 00029002 CR: 24442024 XER: 20000000
TASK = c05f1380[0] 'swapper' THREAD: c0622000 CPU: 0
GPR00: c00247f4 c0623f60 c05f1380 0000003e ebc82e40 00000001 ffffffff
00000000
GPR08: 00000003 00000000 24442022 00021002 0000000e 12802600 00000000
00000000
GPR16: 00000000 7ffb16b8 7ff9bbfd 7ff9bbfd 00000000 00000000 00000000
00000000
GPR24: 00000000 00000000 00001620 c062c934 c0630000 c06206dc c0622040
c062dbc0
NIP [c00247f4] preempt_enable_no_resched+0x64/0x74
LR [c00247f4] preempt_enable_no_resched+0x64/0x74
Call Trace:
[c0623f60] [c00247f4] preempt_enable_no_resched+0x64/0x74 (unreliable)
[c0623f70] [c00083ec] wait_idle+0x84/0xa0
[c0623f90] [c0008434] cpu_idle+0x2c/0x16c
[c0623fb0] [c000218c] rest_init+0xb0/0xcc
[c0623fc0] [c05b6a38] start_kernel+0x2f0/0x304
[c0623ff0] [c00003c4] skpinv+0x2dc/0x318
Instruction dump:
7c0803a6 4e800020 3fe0c063 3bffdbc0 881f0710 2f800001 419effdc 80a20108
3c60c052 388201e0 38632d08 4846d841 <0fe00000> 38000001 981f0710
4bffffb8
Processor 1 found.
Processor 2 found.
Processor 3 found.
Processor 4 found.
Processor 5 found.
Processor 6 found.
Processor 7 found.
Brought up 8 CPUs
NET: Registered protocol family 16

PCI: Probing PCI hardware
bio: create slab at 0
vgaarb: loaded
......

根据信息简单track了一下wait_idle(void)(arch/powerpc/kernel/idle.c),是个easy的问题。

是因为下面的commit引入后多原有的preempt_enable_no_resched()封装了一下,目的是check在preempt_enable_no_resched()后是否进行了及时调度。

------
From b6f90589b71273e331c2c98d750eaa6a94b58622 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner
Date: Fri, 24 Jul 2009 10:22:02 +0200
Subject: [PATCH 14/22] sched: Debug missed preemption checks

Developers use preempt_enable_no_resched() in places where the code
calls schedule() immediately which is correct. But there are places
where preempt_enable_no_resched() is not followed by schedule().

Add debug infrastructre to find the offending code. The identified
correct users are converted to use __preempt_enable_no_resched().

For the ever repeating "preempt_enable_no_resched(); schedule();"
sequences a onvenience macro preempt_enable_and_schedule() is
introduced.
------

这就意味着原有的相关的preempt_enable_no_resched()函数需要更新,以避免不必要的check。更改如下:
                if (cpu_should_die())
                        cpu_die();

-               preempt_enable_no_resched();
-               schedule();
+               preempt_enable_and_schedule();
                preempt_disable();
        }
 }

阅读(1490) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~