关于centos6系统报出的kernel bug的解决方案

简介:

Date:2016.02.15


    今年的第一天上班,就让我意外的发现有两台服务器日志里出现了管理kernel bug的报错。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Feb 14 15:24:15 svn3 kernel: <EOI> 
Feb 14 15:24:15 svn3 kernel: swapper: page allocation failure. order:1, mode:0x20
Feb 14 15:24:15 svn3 kernel: Pid: 0,  comm : swapper Not tainted 2.6.32-431.el6.x86_64  #1
Feb 14 15:24:15 svn3 kernel: Call Trace:
Feb 14 15:24:15 svn3 kernel: <IRQ>  [<ffffffff8112f9e7>] ? __alloc_pages_nodemask+0x757 /0x8d0
Feb 14 15:24:15 svn3 kernel: [<ffffffff8116e482>] ? kmem_getpages+0x62 /0x170
Feb 14 15:24:15 svn3 kernel: [<ffffffff8116f09a>] ? fallback_alloc+0x1ba /0x270
Feb 14 15:24:15 svn3 kernel: [<ffffffff8116eaef>] ? cache_grow+0x2cf /0x320
Feb 14 15:24:15 svn3 kernel: [<ffffffff8116ee19>] ? ____cache_alloc_node+0x99 /0x160
Feb 14 15:24:15 svn3 kernel: [<ffffffff8116fd9b>] ? kmem_cache_alloc+0x11b /0x190
Feb 14 15:24:15 svn3 kernel: [<ffffffff8144c1b8>] ? sk_prot_alloc+0x48 /0x1c0
Feb 14 15:24:15 svn3 kernel: [<ffffffff8144d3c2>] ? sk_clone+0x22 /0x2e0
Feb 14 15:24:15 svn3 kernel: [<ffffffff8149ebf6>] ? inet_csk_clone+0x16 /0xd0
Feb 14 15:24:15 svn3 kernel: [<ffffffff814b84c3>] ? tcp_create_openreq_child+0x23 /0x470
Feb 14 15:24:15 svn3 kernel: [<ffffffff814b5c7d>] ? tcp_v4_syn_recv_sock+0x4d /0x310
Feb 14 15:24:15 svn3 kernel: [<ffffffff814b8266>] ? tcp_check_req+0x226 /0x460
Feb 14 15:24:15 svn3 kernel: [<ffffffff814b56bb>] ? tcp_v4_do_rcv+0x35b /0x490
Feb 14 15:24:15 svn3 kernel: [<ffffffffa0261557>] ? ipv4_confirm+0x87 /0x1d0  [nf_conntrack_ipv4]
Feb 14 15:24:15 svn3 kernel: [<ffffffff814b6f4a>] ? tcp_v4_rcv+0x51a /0x900
Feb 14 15:24:15 svn3 kernel: [<ffffffff814941a0>] ? ip_local_deliver_finish+0x0 /0x2d0
Feb 14 15:24:15 svn3 kernel: [<ffffffff8149427d>] ? ip_local_deliver_finish+0xdd /0x2d0
Feb 14 15:24:15 svn3 kernel: [<ffffffff81494508>] ? ip_local_deliver+0x98 /0xa0
Feb 14 15:24:15 svn3 kernel: [<ffffffff814939cd>] ? ip_rcv_finish+0x12d /0x440
Feb 14 15:24:15 svn3 kernel: [<ffffffff81493f55>] ? ip_rcv+0x275 /0x350
Feb 14 15:24:15 svn3 kernel: [<ffffffff8145b54b>] ? __netif_receive_skb+0x4ab /0x750
Feb 14 15:24:15 svn3 kernel: [<ffffffff810153a3>] ? native_sched_clock+0x13 /0x80
Feb 14 15:24:15 svn3 kernel: [<ffffffff8145f1b8>] ? netif_receive_skb+0x58 /0x60
Feb 14 15:24:15 svn3 kernel: [<ffffffff812686f9>] ? blk_peek_request+0x189 /0x210
Feb 14 15:24:15 svn3 kernel: [<ffffffffa010079c>] ? xennet_poll+0x91c /0xe50  [xen_netfront]
Feb 14 15:24:15 svn3 kernel: [<ffffffffa004953c>] ? do_blkif_request+0x4c /0x560  [xen_blkfront]
Feb 14 15:24:15 svn3 kernel: [<ffffffff81267570>] ? freed_request+0x50 /0x80
Feb 14 15:24:15 svn3 kernel: [<ffffffff81460b43>] ? net_rx_action+0x103 /0x2f0
Feb 14 15:24:15 svn3 kernel: [<ffffffff810e6ef2>] ? handle_IRQ_event+0x92 /0x170
Feb 14 15:24:15 svn3 kernel: [<ffffffff8107a8e1>] ? __do_softirq+0xc1 /0x1e0
Feb 14 15:24:15 svn3 kernel: [<ffffffff8100c30c>] ? call_softirq+0x1c /0x30
Feb 14 15:24:15 svn3 kernel: [<ffffffff8100fa75>] ? do_softirq+0x65 /0xa0
Feb 14 15:24:15 svn3 kernel: [<ffffffff8107a795>] ? irq_exit+0x85 /0x90
Feb 14 15:24:15 svn3 kernel: [<ffffffff81325b95>] ? xen_evtchn_do_upcall+0x35 /0x50
Feb 14 15:24:15 svn3 kernel: [<ffffffff8100c433>] ? xen_hvm_callback_vector+0x13 /0x20
Feb 14 15:24:15 svn3 kernel: <EOI>  [<ffffffff8103eacb>] ? native_safe_halt+0xb /0x10
Feb 14 15:24:15 svn3 kernel: [<ffffffff810167bd>] ? default_idle+0x4d /0xb0
Feb 14 15:24:15 svn3 kernel: [<ffffffff81009fc6>] ? cpu_idle+0xb6 /0x110
Feb 14 15:24:15 svn3 kernel: [<ffffffff8150cbea>] ? rest_init+0x7a /0x80
Feb 14 15:24:15 svn3 kernel: [<ffffffff81c26f8f>] ? start_kernel+0x424 /0x430
Feb 14 15:24:15 svn3 kernel: [<ffffffff81c2633a>] ? x86_64_start_reservations+0x125 /0x129
Feb 14 15:24:15 svn3 kernel: [<ffffffff81c26453>] ? x86_64_start_kernel+0x115 /0x124
Feb 14 15:25:54 svn3 kernel: swapper: page allocation failure. order:1, mode:0x20
Feb 14 15:25:54 svn3 kernel: Pid: 0,  comm : swapper Not tainted 2.6.32-431.el6.x86_64  #1
Feb 14 15:25:54 svn3 kernel: Call Trace:
Feb 14 15:25:54 svn3 kernel: <IRQ>  [<ffffffff8112f9e7>] ? __alloc_pages_nodemask+0x757 /0x8d0
Feb 14 15:25:54 svn3 kernel: [<ffffffff8116e482>] ? kmem_getpages+0x62 /0x170
Feb 14 15:25:54 svn3 kernel: [<ffffffff8116f09a>] ? fallback_alloc+0x1ba /0x270
Feb 14 15:25:54 svn3 kernel: [<ffffffff8116eaef>] ? cache_grow+0x2cf /0x320
Feb 14 15:25:54 svn3 kernel: [<ffffffff8116ee19>] ? ____cache_alloc_node+0x99 /0x160
Feb 14 15:25:54 svn3 kernel: [<ffffffff8116fd9b>] ? kmem_cache_alloc+0x11b /0x190
Feb 14 15:25:54 svn3 kernel: [<ffffffff8144c1b8>] ? sk_prot_alloc+0x48 /0x1c0
Feb 14 15:25:54 svn3 kernel: [<ffffffff8144d3c2>] ? sk_clone+0x22 /0x2e0
Feb 14 15:25:54 svn3 kernel: [<ffffffff8149ebf6>] ? inet_csk_clone+0x16 /0xd0
Feb 14 15:25:54 svn3 kernel: [<ffffffff814b84c3>] ? tcp_create_openreq_child+0x23 /0x470
Feb 14 15:25:54 svn3 kernel: [<ffffffff814b5c7d>] ? tcp_v4_syn_recv_sock+0x4d /0x310
Feb 14 15:25:54 svn3 kernel: [<ffffffff814b8266>] ? tcp_check_req+0x226 /0x460
Feb 14 15:25:54 svn3 kernel: [<ffffffff814b56bb>] ? tcp_v4_do_rcv+0x35b /0x490
Feb 14 15:25:54 svn3 kernel: [<ffffffffa0261557>] ? ipv4_confirm+0x87 /0x1d0  [nf_conntrack_ipv4]
Feb 14 15:25:54 svn3 kernel: [<ffffffff814b6f4a>] ? tcp_v4_rcv+0x51a /0x900
Feb 14 15:25:54 svn3 kernel: [<ffffffff814941a0>] ? ip_local_deliver_finish+0x0 /0x2d0
Feb 14 15:25:54 svn3 kernel: [<ffffffff8149427d>] ? ip_local_deliver_finish+0xdd /0x2d0
Feb 14 15:25:54 svn3 kernel: [<ffffffff81494508>] ? ip_local_deliver+0x98 /0xa0
Feb 14 15:25:54 svn3 kernel: [<ffffffff814939cd>] ? ip_rcv_finish+0x12d /0x440
Feb 14 15:25:54 svn3 kernel: [<ffffffff81493f55>] ? ip_rcv+0x275 /0x350
Feb 14 15:25:54 svn3 kernel: [<ffffffff8145b54b>] ? __netif_receive_skb+0x4ab /0x750
Feb 14 15:25:54 svn3 kernel: [<ffffffff8145f1b8>] ? netif_receive_skb+0x58 /0x60
Feb 14 15:25:54 svn3 kernel: [<ffffffffa010079c>] ? xennet_poll+0x91c /0xe50  [xen_netfront]
Feb 14 15:25:54 svn3 kernel: [<ffffffffa004953c>] ? do_blkif_request+0x4c /0x560  [xen_blkfront]
Feb 14 15:25:54 svn3 kernel: [<ffffffff810ec18e>] ? rcu_start_gp+0x1be /0x230
Feb 14 15:25:54 svn3 kernel: [<ffffffff8126826d>] ? __blk_put_request+0x7d /0xd0
Feb 14 15:25:54 svn3 kernel: [<ffffffff81460b43>] ? net_rx_action+0x103 /0x2f0
Feb 14 15:25:54 svn3 kernel: [<ffffffff810e6ef2>] ? handle_IRQ_event+0x92 /0x170
Feb 14 15:25:54 svn3 kernel: [<ffffffff8107a8e1>] ? __do_softirq+0xc1 /0x1e0
Feb 14 15:25:54 svn3 kernel: [<ffffffff8100c30c>] ? call_softirq+0x1c /0x30
Feb 14 15:25:54 svn3 kernel: [<ffffffff8100fa75>] ? do_softirq+0x65 /0xa0
Feb 14 15:25:54 svn3 kernel: [<ffffffff8107a795>] ? irq_exit+0x85 /0x90
Feb 14 15:25:54 svn3 kernel: [<ffffffff81325b95>] ? xen_evtchn_do_upcall+0x35 /0x50
Feb 14 15:25:54 svn3 kernel: [<ffffffff8100c433>] ? xen_hvm_callback_vector+0x13 /0x20
Feb 14 15:25:54 svn3 kernel: <EOI>  [<ffffffff8103eacb>] ? native_safe_halt+0xb /0x10
Feb 14 15:25:54 svn3 kernel: [<ffffffff810167bd>] ? default_idle+0x4d /0xb0
Feb 14 15:25:54 svn3 kernel: [<ffffffff81009fc6>] ? cpu_idle+0xb6 /0x110
Feb 14 15:25:54 svn3 kernel: [<ffffffff8150cbea>] ? rest_init+0x7a /0x80
Feb 14 15:25:54 svn3 kernel: [<ffffffff81c26f8f>] ? start_kernel+0x424 /0x430
Feb 14 15:25:54 svn3 kernel: [<ffffffff81c2633a>] ? x86_64_start_reservations+0x125 /0x129
Feb 14 15:25:54 svn3 kernel: [<ffffffff81c26453>] ? x86_64_start_kernel+0x115 /0x124


通过百度查询,找到下面的解释:


dmesg里报出这个信息,然后机器负载开始上升,而实际上用free可以看到还有大量的内存被buffer/cached

因此不应该出这个问题才对,我的系统是centos6,上centos的论坛查了一圈,有人回说是内核的bug

一个临时解决方案是

sysctl -w vm.zone_reclaim_mode=1

深究:  

关于zone_reclaim_mode的定义kernel的文档里描述如下

Zone_reclaim_mode allows someone to set more or less aggressive approaches to
reclaim memory when a zone runs out of memory. If it is set to zero then no
zone reclaim occurs. Allocations will be satisfied from other zones / nodes
in the system.

This is value ORed together of

1 = Zone reclaim on
2 = Zone reclaim writes dirty pages out
4 = Zone reclaim swaps pages

zone_reclaim_mode is set during bootup to 1 if it is determined that pages
from remote zones will cause a measurable performance reduction. The
page allocator will then reclaim easily reusable pages (those page
cache pages that are currently not used) before allocating off node pages.

It may be beneficial to switch off zone reclaim if the system is
used for a file server and all of memory should be used for caching files
from disk. In that case the caching effect is more important than
data locality.

Allowing zone reclaim to write out pages stops processes that are
writing large amounts of data from dirtying pages on other nodes. Zone
reclaim will write out dirty pages if a zone fills up and so effectively
throttle the process. This may decrease the performance of a single process

since it cannot use all of system memory to buffer the outgoing writes
anymore but it preserve the memory on other nodes so that the performance
of other processes running on other nodes will not be affected.

Allowing regular swap effectively restricts allocations to the local
node unless explicitly overridden by memory policies or cpuset
configurations 

这个参数告诉内核当内存不够用时就直接回收buffer/cache











本文转自 南非波波 51CTO博客,原文链接:http://blog.51cto.com/nanfeibobo/1742072,如需转载请自行联系原作者
目录
相关文章
|
5天前
|
Linux 网络安全 数据安全/隐私保护
Linux系统之Centos7安装cockpit图形管理界面
【10月更文挑战第12天】Linux系统之Centos7安装cockpit图形管理界面
24 1
Linux系统之Centos7安装cockpit图形管理界面
|
3月前
|
Linux 虚拟化 数据安全/隐私保护
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
部署05-VMwareWorkstation中安装CentOS7 Linux操作系统, VMware部署CentOS系统第一步,下载Linux系统,/不要忘, CentOS -7-x86_64-DVD
|
27天前
|
网络协议 Linux Shell
CentOS7系统命令学习笔记(一)
CentOS7系统命令学习笔记(一)
61 12
|
27天前
|
Linux
CentOS7系统命令学习笔记(二)
CentOS7系统命令学习笔记(二)
49 10
|
27天前
|
Linux Shell API
CentOS7系统命令学习笔记(三)
CentOS7系统命令学习笔记(三)
50 8
|
13天前
|
缓存 Linux 编译器
【C++】CentOS环境搭建-安装log4cplus日志组件包及报错解决方案
通过上述步骤,您应该能够在CentOS环境中成功安装并使用log4cplus日志组件。面对任何安装或使用过程中出现的问题,仔细检查错误信息,对照提供的解决方案进行调整,通常都能找到合适的解决之道。log4cplus的强大功能将为您的项目提供灵活、高效的日志管理方案,助力软件开发与维护。
32 0
|
2月前
|
机器学习/深度学习 文字识别 Linux
百度飞桨(PaddlePaddle) - PP-OCRv3 文字检测识别系统 基于 Paddle Serving快速使用(服务化部署 - CentOS 7)
百度飞桨(PaddlePaddle) - PP-OCRv3 文字检测识别系统 基于 Paddle Serving快速使用(服务化部署 - CentOS 7)
66 1
百度飞桨(PaddlePaddle) - PP-OCRv3 文字检测识别系统 基于 Paddle Serving快速使用(服务化部署 - CentOS 7)
|
2月前
|
运维 网络协议 Linux
揭秘CentOS 7:系统目录奥秘大起底,网卡配置秒变高手,让你的服务器管理飞一般的感觉!
【8月更文挑战第5天】CentOS 7作为RHEL的社区版本,以其稳定性和丰富功能广受好评。本文通过案例分析介绍其系统目录结构及网卡配置方法。系统目录如/(根)、/bin(基本命令)、/boot(启动文件)、/dev(设备文件)、/etc(配置文件)、/home(用户目录)和/lib(共享库)等各司其职。网卡配置通过编辑/etc/sysconfig/network-scripts/下的ifcfg文件实现,如设置ens33接口的静态IP地址、子网掩码、网关和DNS服务器,并通过重启网络服务使配置生效。这是系统管理员必备的技能之一。
54 2
|
2月前
|
Linux 开发工具
CentOS7系统初始化个人配置
CentOS7系统初始化个人配置
|
3月前
|
Linux
CentOS 7 上挂载硬盘到系统
在 CentOS 7 中挂载硬盘,步骤包括:1、查找未挂载磁盘;2、创建分区;3、格式化为 ext4;4创建挂载点;5、挂载硬盘;6、检查挂载状态;7、 编辑 `/etc/fstab` 以实现开机自动挂载。
269 3