还没想好用什么标题

0%

Optimizing the kernel for VMware

参考地址: Optimizing the kernel for VMware

今天在vps上编译了一个内核,启动的时候发现死机了。。。
之后再本地测试了一下也是同样的情况,网上搜了一下 这是结果

要问我为何编译内核? 为了测试下cjktty,经实验效果还是可以的,之后再在这篇文章补充这方面的内容 嗯,先这样吧

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
[*] 64-bit kernel (leave blank for x86) 

General Setup --->
[*] Optimize very unlikely/likely branches

Processor type and features --->
Processor Family (usually Core2/Newer Xeon)

Bus Options --->
< > PCCard (PCMCIA/Cardbus) support

Networking support --->
[ ] Amateur Radio support
[ ] Wireless (only if you plan on using nat EXCLUSIVELY)

Device Drivers --->
Generic Driver Options
[*] Maintain a devtmpfs filesystem to mount at /dev

Misc Devices --->
[*] VMware Balloon Driver (manages memory between VM and host)
[*] VMware VMCI Driver (Virtual Machine Communication Interface - low-latency access to host memory bus)

SCSI device support --->
[*] SCSI low-level drivers --->
<*> VMware PVSCSI driver support (high throughput storage adapter)

[*] Fusion MPT device support --->
<*> Fusion MPT ScsiHost drivers for SPI

[*] Network device support --->
[*] Ethernet driver support --->
(disable every driver but this)
[*] AMD Devices
<*> AMD PCNet32 PCI support
[ ] Wireless LAN (ONLY if you disabled Wireless networking support above)
< > VMware VMXNET3 ethernet driver (PCNet32 is more than enough for most use cases - enable this only if you have spare cpu cycles to burn)

Graphics support --->
<*> Direct Rendering Manager
< > Intel 8xx/9xx/G3x/G4x/HD Graphics
<*> DRM driver for VMware Virtual GPU
[*] Enable framebuffer console support under vmwgfx by default
<*> Support for frame buffer devices

Console display driver support --->
<*> Framebuffer Console support

Sound card support --->
<*> Advanced Linux Sound Architecture --->
[*] PCI sound devices
<*> (Creative) Ensoniq AudioPCI 1371/1373
< > Intel HD Audio

File systems --->
(enable only those you anticipate using)
<*> Second extended fs support
<*> The Extended 4 (ext4) filesystem
<*> XFS filesystem support
<*> Btrfs filesystem Unstable disk format

Pseudo filesystems --->
[*] Tmpfs virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists

对于网卡,之前看一些blog都说使用 pcnet32 的驱动就可以了,我这里使用的是intel的 e1000 的驱动,其实intel的这个驱动也是很常见的,vmware和vobx都会有用到。其他方面基本没啥特殊情况了,毕竟只是vps,没啥必要做什么优化(况且我也不会 -_-!)
为了保证基于kvm的虚拟机能够正常网络通信,最好内核启用virtio

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Processor type and features  --->
[*] Linux guest support --->
[*] Enable Paravirtualization code
[*] KVM Guest support (including kvmclock)
Device Drivers --->
Virtio drivers --->
<*> PCI driver for virtio devices
[*] Block devices --->
<*> Virtio block driver
[*] Network device support --->
<*> Virtio network driver
SCSI device support --->
[*] SCSI low-level drivers --->
[*] virtio-scsi support

有关cjktty的内容请关注 linux-cjktty
同时 MicroCai 在IBM上有篇文章介绍了这个项目

使用4.9内核的bbr 编译内核的时候搜索bbr,把两个选项勾选,/etc/sysctl.conf里面加上两句:

1
2
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

使用IPsec可能需要这下

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
Networking  --->
Networking options --->
Transformation user configuration interface [CONFIG_XFRM_USER]
PF_KEY sockets [CONFIG_NET_KEY]
TCP/IP networking [CONFIG_INET]
IP: advanced router [CONFIG_IP_ADVANCED_ROUTER]
IP: policy routing [CONFIG_IP_MULTIPLE_TABLES]
IP: AH transformation [CONFIG_INET_AH]
IP: ESP transformation [CONFIG_INET_ESP]
IP: IPComp transformation [CONFIG_INET_IPCOMP]
IP: IPsec transport mode [CONFIG_INET_XFRM_MODE_TRANSPORT]
IP: IPsec tunnel mode [CONFIG_INET_XFRM_MODE_TUNNEL]
IP: IPsec BEET mode [CONFIG_INET_XFRM_MODE_BEET]
The IPv6 protocol ---> [CONFIG_IPV6]
IPv6: AH transformation [CONFIG_INET6_AH]
IPv6: ESP transformation [CONFIG_INET6_ESP]
IPv6: IPComp transformation [CONFIG_INET6_IPCOMP]
IPv6: IPsec transport mode [CONFIG_INET6_XFRM_MODE_TRANSPORT]
IPv6: IPsec tunnel mode [CONFIG_INET6_XFRM_MODE_TUNNEL]
IPv6: IPsec BEET mode [CONFIG_INET6_XFRM_MODE_BEET]
IPv6: Multiple Routing Tables [CONFIG_IPV6_MULTIPLE_TABLES]
Network packet filtering framework (Netfilter) ---> [CONFIG_NETFILTER]
Core Netfilter Configuration --->
Netfilter Xtables support [CONFIG_NETFILTER_XTABLES]
IPsec "policy" match support [CONFIG_NETFILTER_XT_MATCH_POLICY]
Cryptographic API
Select algorithms you want to use...
Encrypted Chain IV Generator [CRYPTO_ECHAINIV]