Chinaunix首页 | 论坛 | 博客
  • 博客访问: 346023
  • 博文数量: 167
  • 博客积分: 2867
  • 博客等级: 少校
  • 技术积分: 1306
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-12 00:08
文章分类

全部博文(167)

文章存档

2017年(10)

2016年(5)

2015年(9)

2014年(10)

2013年(5)

2012年(17)

2011年(110)

2010年(1)

我的朋友

分类: LINUX

2011-06-16 23:23:58

    问题描述:这几天在xen上安装虚拟机的时候,出现了这个问题,安装A虚拟机,加载了些内核模块,然后拷贝这个虚拟机的磁盘,使用这个拷贝磁盘,创建虚拟机B,启动虚拟机B,给出panic
kernel panic - not syncing:Out of memory and no killable processes...
     怀疑是启动时候增加的内核模块的问题,在B上启动不加载内核模块的内核版本,结果启动正常。
     在内核中找了这句话的出处:
./mm/oom_kill.c
/*
 * Must be called with tasklist_lock held for read.
 */
static void __out_of_memory(gfp_t gfp_mask, int order)
{
        struct task_struct *p; 
        unsigned long points;

        if (sysctl_oom_kill_allocating_task)
                if (!oom_kill_process(current, gfp_mask, order, 0, NULL,
                                "Out of memory (oom_kill_allocating_task)"))
                        return;
retry:
        /*
         * Rambo mode: Shoot down a process and hope it solves whatever
         * issues we may have.
         */
        p = select_bad_process(&points, NULL);

        if (PTR_ERR(p) == -1UL)
                return;

        /* Found nothing?!?! Either we hang forever, or we panic. */
        if (!p) {
                read_unlock(&tasklist_lock);
                panic("Out of memory and no killable processes...\n");
        }

        if (oom_kill_process(p, gfp_mask, order, points, NULL,
                             "Out of memory"))
                goto retry;
}

也就是说在没有bad process情况下,给出了上文的panic,就是说不是具体的进程内存访问越界了,那是什么访问越界了呢?详细看下select_bad_process
              .....
问题的最终原因是增加的新内核模块内存越界了,它们怎么会越界呢?原因是创建新虚拟机的时候给的内存太小,这些内核模块在初始化时候插入时引起这个panic.

./arch/x86/mm/fault.c
do_page_fault()--->mm_fault_error()--->out_of_memory()
--->pagefault_out_of_memory()--->__out_of_memory()

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