问题描述:这几天在xen上安装虚拟机的时候,出现了这个问题,安装A虚拟机,加载了些内核模块,然后
拷贝这个虚拟机的磁盘,使用这个拷贝磁盘,创建虚拟机B,启动虚拟机B,给出panickernel 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()
阅读(1740) | 评论(0) | 转发(0) |