免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3857 | 回复: 17
打印 上一主题 下一主题

运行panic()后还能调度吗? [复制链接]

论坛徽章:
7
丑牛
日期:2013-10-18 14:43:21技术图书徽章
日期:2013-11-03 09:58:03辰龙
日期:2014-01-15 22:57:50午马
日期:2014-09-15 07:04:39丑牛
日期:2014-10-16 14:25:222015年亚洲杯之伊朗
日期:2015-03-16 10:24:352015亚冠之城南
日期:2015-05-31 09:52:32
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-29 10:19 |只看该作者 |倒序浏览
好就关了抢占而已

论坛徽章:
0
2 [报告]
发表于 2008-08-29 10:31 |只看该作者
原帖由 smalloc 于 2008-8-29 10:19 发表
好就关了抢占而已

关了抢占等价于不调度

论坛徽章:
0
3 [报告]
发表于 2008-08-29 12:33 |只看该作者
运行panic之后你机器还活着吗?

论坛徽章:
7
丑牛
日期:2013-10-18 14:43:21技术图书徽章
日期:2013-11-03 09:58:03辰龙
日期:2014-01-15 22:57:50午马
日期:2014-09-15 07:04:39丑牛
日期:2014-10-16 14:25:222015年亚洲杯之伊朗
日期:2015-03-16 10:24:352015亚冠之城南
日期:2015-05-31 09:52:32
4 [报告]
发表于 2008-08-29 12:35 |只看该作者
神说:它需要活着。。。
能活一会是一会

[ 本帖最后由 smalloc 于 2008-8-29 12:36 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2008-08-29 12:44 |只看该作者
panic之后中断是开的,软中断能运行,比如ping会响应

论坛徽章:
0
6 [报告]
发表于 2008-08-29 12:50 |只看该作者
我估计你看到的不是panic,而是WARN_ON或BUG。
真的panic会重启系统。BUG是死循环做ud2指令,类似于NOP指令。,warn_on就打一些calltrace而已。

[ 本帖最后由 zx_wing 于 2008-8-29 12:53 编辑 ]

论坛徽章:
7
丑牛
日期:2013-10-18 14:43:21技术图书徽章
日期:2013-11-03 09:58:03辰龙
日期:2014-01-15 22:57:50午马
日期:2014-09-15 07:04:39丑牛
日期:2014-10-16 14:25:222015年亚洲杯之伊朗
日期:2015-03-16 10:24:352015亚冠之城南
日期:2015-05-31 09:52:32
7 [报告]
发表于 2008-08-29 12:54 |只看该作者
原帖由 zx_wing 于 2008-8-29 12:50 发表
我估计你看到的不是panic,而是WARN_ON或BUG。
真的panic会重启系统。BUG是死循环做ud2指令,类似于NOP指令。,warn_on就打一些calltrace而已。

那么什么情况下会真正的panic?

论坛徽章:
0
8 [报告]
发表于 2008-08-29 12:58 |只看该作者
原帖由 smalloc 于 2008-8-29 12:54 发表

那么什么情况下会真正的panic?

内核调用panic()函数的时候

论坛徽章:
0
9 [报告]
发表于 2008-08-29 13:01 |只看该作者
默认是不重启的吧
启动参数可以该改变成重启
/**
*    panic - halt the system
*    @fmt: The text string to print
*
*    Display a message, then perform cleanups.
*
*    This function never returns.
*/


NORET_TYPE void panic(const char * fmt, ...)
{
    long i;
    static char buf[1024];
    va_list args;
#if defined(CONFIG_S390)
    unsigned long caller = (unsigned long) __builtin_return_address(0);
#endif

    /*
     * It's possible to come here directly from a panic-assertion and not
     * have preempt disabled. Some functions called from here want
     * preempt to be disabled. No point enabling it later though...
     */

    preempt_disable();

    bust_spinlocks(1);
    va_start(args, fmt);
    vsnprintf(buf, sizeof(buf), fmt, args);
    va_end(args);
    printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
    bust_spinlocks(0);

    /*
     * If we have crashed and we have a crash kernel loaded let it handle
     * everything else.
     * Do we want to call this before we try to display a message?
     */

    crash_kexec(NULL);

#ifdef CONFIG_SMP
    /*
     * Note smp_send_stop is the usual smp shutdown function, which
     * unfortunately means it may not be hardened to work in a panic
     * situation.
     */

    smp_send_stop();
#endif

    atomic_notifier_call_chain(&panic_notifier_list, 0, buf);

    if (!panic_blink)
        panic_blink = no_blink;

    if (panic_timeout > 0) {
        /*
          * Delay timeout seconds before rebooting the machine.
         * We can't use the "normal" timers since we just panicked..
          */

        printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout);
        for (i = 0; i < panic_timeout*1000; ) {
            touch_nmi_watchdog();
            i += panic_blink(i);
            mdelay(1);
            i++;
        }
        /*    This will not be a clean reboot, with everything
         *    shutting down.  But if there is a chance of
         *    rebooting the system it will be rebooted.
         */

        emergency_restart();
    }
#ifdef __sparc__
    {
        extern int stop_a_enabled;
        /* Make sure the user can actually press Stop-A (L1-A) */
        stop_a_enabled = 1;
        printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot prom\n");
    }
#endif
#if defined(CONFIG_S390)
    disabled_wait(caller);
#endif
    local_irq_enable();
    for (i = 0;;) {
        touch_softlockup_watchdog();
        i += panic_blink(i);
        mdelay(1);
        i++;
    }
}

论坛徽章:
7
丑牛
日期:2013-10-18 14:43:21技术图书徽章
日期:2013-11-03 09:58:03辰龙
日期:2014-01-15 22:57:50午马
日期:2014-09-15 07:04:39丑牛
日期:2014-10-16 14:25:222015年亚洲杯之伊朗
日期:2015-03-16 10:24:352015亚冠之城南
日期:2015-05-31 09:52:32
10 [报告]
发表于 2008-08-29 14:40 |只看该作者
需要在重启前做些收尾的工作,否则网卡芯片在重启后不能正常工作。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP