Linux 2.6.31內核優化指南

本文來自Ken Wu的博客,原文連接:http://kenwublog.com/docs/linux-kernel-2-6-31-optimization.htmhtml

介紹linux

本文檔是一篇關於Linux Kernel 2.6.31的最簡優化指南。做者旨在編譯一份性能最佳且適合普通Application/Server開發用的內核。
本文說起的內核調優,主要是經過選擇最佳編譯選項,刪除無用驅動,減小內核尺寸等方式來進行的。ios

因爲做者水平有限,若是描述錯誤,還請不吝指教。git

運行環境web

虛擬機shell

Virtualbox 3.1.4windows

CPU安全

Core 2 Duo P9500 2.53G 雙核 開啓 vt-x, APICcookie

磁盤網絡

虛擬 10G的SATA磁盤

內存

分了1G物理內存

網卡

虛擬 AMD PCNet32 100M

其餘

USB,串口,顯卡,聲卡全關

做者是在虛擬機中編譯的內核,若是你與做者的運行環境不一樣,則本文檔中的部分描述可能會與你的實際狀況有必定出入。

不過,相信大部分用戶在看到選項釋義時,能作出適合本身的選擇。

說明

下列選項中,經過 "// " 註釋的行,表明金國步寫的內核選項簡介中未說起的選項釋義。

經過紅色 "<===" 註釋的行,表明內核默認開啓,本文檔推薦關閉的選項,釋義部分會給出關閉的理由。

參考資料

金國步寫的內核選項簡介

Linux Kernel Database

Linuxsir BBS

General setup --->

[ ] Prompt for development and/or incomplete code/drivers <=== 顯示尚在開發中或還沒有完成的代碼和驅動. 我不是內核或驅動開發人員。

() Local version - append to kernel release

[ ] Automatically append version information to the version string

Kernel compression mode (Bzip2) ---> <=== 對比默認的Gzip,Bzip2擁有更高的壓縮比

[*] Support for paging of anonymous memory (swap)

[*] System V IPC

[*] BSD Process Accounting

[ ] BSD Process Accounting version 3 file format

[ ] Export task/process statistics through netlink (EXPERIMENTAL) <=== 體驗類選項一概關

[ ] Auditing support <=== 給SELinux提供支持。個人使用場景主要是開發應用程序,不須要那麼高的安全性,另外安全老是以犧牲性能爲代價

RCU Subsystem ---> // 非對稱讀寫鎖系統 是一種新的kernel鎖機制,適用於讀多寫少環境

RCU Implementation (Classic RCU) ---> <=== 選擇標準的RCU系統, tree-base是給擁有大規模CPU集羣的SMP系統用的

< > Kernel .config support

(18) Kernel log buffer size (16 => 64KB, 17 => 128KB)

[] Control Group support ---><=== cgroups支持,文檔資料,cgroups主要做用是給進程分組,並能夠動態調控進程組的CPU佔用率。好比A進程分到apple組,給予20%CPU佔用率,E進程分easy組,給予50%CPU佔用率,最高100%。我目前沒有此類應用場景,用到時會選擇將其編譯進去。

[] Kernel->user space relay support (formerly relayfs) <=== 在某些文件系統上(好比debugfs)提供從內核空間向用戶空間傳遞大量數據的接口,我目前沒有此類應用場景

-*- Namespaces support

[] UTS namespace <=== 我沒有已安裝的應用程序要用到 UTS ns

[] IPC namespace <=== 我沒有已安裝的應用程序要用到 IPC ns

[] Initial RAM filesystem and RAM disk (initramfs/initrd) support <=== 用於在真正內核裝載前,作一些操做(俗稱兩階段啓動),好比加載module,mount一些非root分區,提供災難恢復shell環境等,資料,我是指望直接從kernel image直接啓動,因此沒選它

[*] Optimize for size

[ ] Configure standard kernel features (for small systems) --->

-*- Load all symbols for debugging/ksymoops

[ ] Do an extra kallsyms pass <=== 除非你在kallsyms中發現了bug並須要報告這個bug纔打開該選項

Performance Counters --->

[*] Kernel Performance Counters // CPU 性能監聽器,包括 CPU同一時間執行指令數,cache miss數,分支預測失敗次數(Branch misprediction)。調優其餘程序時或許會用到,好比JVM

[ ] Strip assembler-generated symbols during link

[ ] Disable heap randomization

Choose SLAB allocator (SLUB (Unqueued Allocator)) --->

[ ] Profiling support (EXPERIMENTAL) <=== 我不是內核開發人員,不須要profile內核

[] Activate markers <=== 一種運行時狀態分析診斷工具,相似 instrumentation,資料,我用不到

[ ] Kprobes <=== 我不是內核開發人員,不須要調試內核

GCOV-based kernel profiling --->

[ ] Enable gcov-based kernel profiling

[*] Enable loadable module support ---> // 我不多使用dynamic module loading,因此,下面的選項只留一個unloading便可(默認)

--- Enable loadable module support

[ ] Forced module loading

[*] Module unloading

[ ] Module versioning support

[ ] Source checksum for all modules

-*- Enable the block layer --->

--- Enable the block layer

[*] Support for large (2TB+) block devices and files // 大硬盤支持,SATA設備若是不選,會發生 kernel panic,具體緣由未知

[ ] Block layer SG support v4 <=== 支持通用scsi塊設備第4版,我用的是SATA

[ ] Block layer data integrity support

IO Schedulers ---> // IO調度器支持,不一樣程序能夠會選用不一樣的調度策略,這裏咱們不要動他

<*> Anticipatory I/O scheduler

<*> Deadline I/O scheduler

<*> CFQ I/O scheduler

Default I/O scheduler (CFQ) --->

Processor type and features --->

[*] Tickless System (Dynamic Ticks) // CPU節能,動態時間片意思是當CPU處於空閒時,下降內核定時器的輪詢頻率

[*] High Resolution Timer Support // 我有的時候要測試 Real Time JVM,但願內核能支持這種高響應速度的內核定時器,通常用戶可關閉

[*] Symmetric multi-processing support

[ ] Support sparse irq numbering <=== 若是你想支持大量CPU,又想使用較低的內核內存佔用,請啓用它。我只有單塊CPU

[*] Enable MPS table // 讓多核/多CPU系統支持ACPI

[ ] Support for big SMP systems with more than 8 CPUs

[ ] Support for extended (non-PC) x86 platforms <=== 我是X86平臺,不須要再支持其餘平臺

[*] Single-depth WCHAN output // 跟 proc 相關的最好不要關

[ ] Paravirtualized guest support --->

--- Paravirtualized guest support

[ ] Memtest

Processor family (Core 2/newer Xeon) ---> <=== 這裏請選擇對應的CPU,我是 core 2 duo

[ ] Generic x86 support <=== 通用x86支持, 若是你的CPU可以在上述"Processor family"中找到就別選了

[*] HPET Timer Support

(4) Maximum number of CPUs <=== 個人CPU是雙核,算上超線程HT最多虛擬4顆邏輯CPU,因此我選4 ,默認是8

[*] SMT (Hyperthreading) scheduler support

[*] Multi-core scheduler support

Preemption Model (Voluntary Kernel Preemption (Server)) ---> <=== 這裏我選擇了Server,它最貼近個人使用場景

[*] Reroute for broken boot IRQs // 防止同時收到多個boot IRQ(中斷)時,系統混亂

[*] Machine Check Exception

[ ] Use legacy machine check code (will go away)

[*] Intel MCE features

[ ] AMD MCE features <=== 我是intel CPU

[ ] Support for old Pentium 5 / WinChip machine checks

< > Machine check injector support

< > Toshiba Laptop support

< > Dell laptop support

[ ] Enable X86 board specific fixups for reboot <=== 修正某些舊x86主板的重起bug,這種主板基本絕種了

<*> /dev/cpu/microcode - microcode support

[*] Intel microcode patch loading support

[ ] AMD microcode patch loading support <=== 我是intel CPU

<*> /dev/cpu/*/msr - Model-specific register support

<*> /dev/cpu/*/cpuid - CPU information support

< > /sys/kernel/debug/x86/cpu/* - CPU Debug support

High Memory Support (4GB) --->

(4096) Low address space to protect from user allocation

[*] Allocate 3rd-level pagetables from highmem <=== 在內存不少(大於4G)的機器上將用戶空間的頁表放到高位內存區,以節約寶貴的低端內存,我只虛擬了1G

[ ] Check for low memory corruption <=== 低位內存髒數據檢查,默認是每60秒檢查一次。通常這種髒數據是因某些Bios處理不當引發的。資料連接。我信任我目前的虛擬bios版本

[] Reserve low 64K of RAM on AMI/Phoenix BIOSen <=== 我不是AMI/Phoenix BIOS

[ ] Math emulation

[ ] MTRR (Memory Type Range Register) support <=== 我沒用 X windows

[ ] MTRR cleanup support

[ ] x86 PAT support <=== 我沒用 X windows

[ ] EFI runtime service support <=== 我機器是BIOS引導的,用不到EFI(Extensible Firmware Interface),若是你有興趣體驗EFI,能夠在Virtualbox中開啓

[] Enable seccomp to safely compute untrusted bytecode <=== 只有嵌入式系統能夠不選

[ ] Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)

Timer frequency (300 HZ) ---> <=== Server場景建議設爲300hz,減小內核事件響應速度,提升程序吞吐量,桌面場景能夠保持不變

[ ] kexec system call <=== 我沒有運行時替換內核的需求

[ ] kernel crash dumps <=== 內核崩潰時,dump運行時信息。就算crash了,我也不會去調試內核的core dump

[ ] Build a relocatable kernel <=== 官方說明(創建一個移動的內核,並增長10%的內核尺寸,運行時會被丟棄),我認爲沒實質性的做用

(0x1000000) Physical address where the kernel is loaded

[] Support for hot-pluggable CPUs <=== 熱拔插CPU,我用不到

[ ] Compat VDSO support

[ ] Built-in kernel command line

Power management and ACPI options --->

[*] Power Management support

[ ] Power Management Debug Support <=== 不想調試ACPI

[ ] Verbose Power Management debugging

[ ] Suspend to RAM and standby <=== 我是用來跑server,通常不須要待機

[ ] Hibernation (aka 'suspend to disk') <=== 我是用來跑server,通常不須要休眠

[*] ACPI (Advanced Configuration and Power Interface) Support --->

[*] Deprecated /proc/acpi files

[*] Deprecated power /proc/acpi directories

[*] Future power /sys interface

[*] Deprecated /proc/acpi/event support

< > AC Adapter <=== 我不須要從AC與Battery之間作切換

< > Battery <=== 沒有電池

< > Button <=== 沒有Fn快捷鍵

-*- Video

<*> Fan

<*> Processor

<*> Thermal Zone

(0) Disable ACPI for systems before Jan 1st this year

[ ] Debug Statements

< > PCI slot detection driver

< > Smart Battery System

CPU Frequency scaling --->

[*] CPU Frequency scaling

[ ] Enable CPUfreq debugging <=== 我不須要調試 CPUfreq

< > CPU frequency translation statistics

Default CPUFreq governor (performance) ---> <=== 默認用 performance高性能的CPU調頻方式

<*> 'performance' governor

< > 'powersave' governor

<> 'userspace' governor for userspace frequency scaling <=== 既容許手動調整cpu頻率,也容許用戶空間的程序動態的調整cpu頻率(須要額外的調頻軟件,好比cpufreqd) 我只用 performance

<> 'ondemand' cpufreq policy governor <=== "週期性的考察CPU負載並自動的動態調整cpu頻率",我只用 performance

<> 'conservative' cpufreq governor

*** CPUFreq processor drivers ***

<*> ACPI Processor P-States driver

< > AMD Mobile K6-2/K6-3 PowerNow!

< > AMD Mobile Athlon/Duron PowerNow!

< > AMD Opteron/Athlon64 PowerNow!

< > Cyrix MediaGX/NatSemi Geode Suspend Modulation

< > Intel Enhanced SpeedStep (deprecated)

< > Intel Speedstep on ICH-M chipsets (ioport interface)

< > Intel Pentium 4 clock modulation

< > Transmeta LongRun

< > VIA Cyrix III Longhaul

Bus options (PCI etc.) --->

[*] PCI support

PCI access mode (Any) --->

[*] PCI Express support

[*] Root Port Advanced Error Reporting support // 硬件驅動會負責發送錯誤信息

[ ] PCI Express ECRC settings control

< > PCIE AER error injector support

[*] Message Signaled Interrupts (MSI and MSI-X)

[ ] Enable deprecated pci_find_* API

[ ] PCI Debugging

< > PCI Stub driver

[*] Interrupts on hypertransport devices

[ ] PCI IOV support

[ ] ISA support

[ ] MCA support

< > NatSemi SCx200 support

[ ] One Laptop Per Child support

< > PCCard (PCMCIA/CardBus) support ---> <=== 通常筆記本電腦會配備PCCard接口(無線網卡之類的),看你的硬件和使用場景吧。雖然我也是NB,但我歷來不用PCMCIA

< > Support for PCI Hotplug ---> <=== 我沒有要熱拔插PCI設備的需求

Executable file formats / Emulations --->

[*] Kernel support for ELF binaries

[*] Write ELF core dumps with partial segments

< > Kernel support for a.out and ECOFF binaries

<*> Kernel support for MISC binaries

[*] Networking support --->

Networking options --->

<*> Packet socket

[*] Packet socket: mmapped IO

<*> Unix domain sockets

<*> Transformation user configuration interface

< > PF_KEY sockets

[*] TCP/IP networking

[*] IP: multicasting

[*] IP: advanced router

Choose IP: FIB lookup algorithm (choose FIB_HASH if unsure) (FIB_HASH) --->

[*] IP: policy routing

[*] IP: equal cost multipath

[*] IP: verbose route monitoring

[ ] IP: kernel level autoconfiguration <=== 我不多用網絡引導OS,內核級別的網絡配置對我無用。

[ ] IP: DHCP support

[ ] IP: BOOTP support

[ ] IP: RARP support

< > IP: tunneling

< > IP: GRE tunnels over IP

[*] IP: multicast routing

[*] IP: PIM-SM version 1 support

[*] IP: PIM-SM version 2 support

[ ] IP: ARP daemon support

[ ] IP: TCP syncookie support (disabled per default) <=== 抵抗SYN flood攻擊,我是開發機,暫不考慮安全特性

< > IP: AH transformation

< > IP: ESP transformation

< > IP: IPComp transformation

< > IP: IPsec transport mode

< > IP: IPsec tunnel mode

< > IP: IPsec BEET mode

[*] Large Receive Offload (ipv4/tcp)

< > INET: socket monitoring interface

[ ] TCP: advanced congestion control ---> <=== 高級擁塞控制,若是沒有特殊需求(好比無線網絡)就別選了

< > The IPv6 protocol ---> <=== 我暫時沒有要支持IPV6的需求

[ ] NetLabel subsystem support <=== NetLabel子系統, 爲諸如CIPSO與RIPSO之類可以在分組信息上添加標籤的協議提供支持,我用不到

[ ] Security Marking <=== 對網絡包進行安全標記,相似於nfmark,但主要是爲安全目的而設計, 安全特性,我暫時不考慮

[ ] Network packet filtering framework (Netfilter) ---> <=== 我不打算使用防火牆,要用到時再編譯進去

< > Asynchronous Transfer Mode (ATM)

< > 802.1d Ethernet Bridging

< > 802.1Q VLAN Support

< > DECnet Support

< > ANSI/IEEE 802.2 LLC type 2 Support

< > The IPX protocol

< > Appletalk protocol support

< > Phonet protocols family

[ ] QoS and/or fair queueing ---> <=== 經過IPRoute切換網絡設備上的Qos策略,我不打算使用IP路由

[ ] Data Center Bridging support

Network testing --->

[ ] Amateur Radio support ---> <=== 我沒有無線電

< > CAN bus subsystem support --->

< > IrDA (infrared) subsystem support --->

< > Bluetooth subsystem support --->

[ ] Wireless ---> <=== 我沒有使用無線網卡

< > RF switch subsystem support ---> <=== 我沒有RF切換設備

Device Drivers --->

Generic Driver Options --->

(/sbin/hotplug) path to uevent helper

[*] Prevent firmware from being built

-*- Userspace firmware loading support

[*] Include in-kernel firmware blobs in kernel binary

() External firmware blobs to build into the kernel binary

[ ] Driver Core verbose debug messages

[ ] Managed device resources verbose debug messages <=== 管理設備資源的冗長調試信息,我不須要

<*> Connector - unified userspace <-> kernelspace linker --->// 內核空間與用戶空間的信道

[*] Report process events to userspace // 報告處理時間給用戶空間

< > Memory Technology Device (MTD) support --->

< > Parallel port support --->

-*- Plug and Play support --->

[ ] PNP debugging messages <=== 調試信息,老規矩

[ ] Block devices ---> <=== 我沒有想要支持的塊設備,好比ramdisk, 磁盤陣列,CD/DVD刻錄等,詳見內部選項

[ ] Misc devices ---> <=== 沒有須要支持的雜項設備

< > ATA/ATAPI/MFM/RLL support --->

SCSI device support --->

< > RAID Transport Class

-*- SCSI device support

[] legacy /proc/scsi/ support <=== 我沒有SCSI設備

*** SCSI support type (disk, tape, CD-ROM) ***

<*> SCSI disk support // 就算你用SATA,此選項也必選

< > SCSI tape support

< > SCSI OnStream SC-x0 tape support

<> SCSI CDROM support <=== 我沒有SCSI設備

<> SCSI generic support <=== 我沒有SCSI設備

< > SCSI media changer support

[ ] Probe all LUNs on each SCSI device

[] Verbose SCSI error reporting (kernel size +=12K) <=== 我沒有SCSI設備

[ ] SCSI logging facility

[ ] Asynchronous SCSI scanning

SCSI Transports --->

<> Parallel SCSI (SPI) Transport Attributes <=== 我沒有SCSI設備

< > FiberChannel Transport Attributes

< > iSCSI Transport Attributes

< > SAS Domain Transport Attributes

< > SRP Transport Attributes

[ ] SCSI low-level drivers --->

< > SCSI Device Handlers --->

< > OSD-Initiator library

Serial ATA (prod) and Parallel ATA (experimental) drivers --->

[*] ATA ACPI Support

[ ] SATA Port Multiplier support <=== 我只有一枚SATA設備,沒有使用多路SATA/SATA Hub 的需求。Port Multiplier是南橋芯片提供的一種支持多塊SATA設備,並共享總帶寬的技術。

<*> AHCI SATA support

< > Silicon Image 3124/3132 SATA support

[*] ATA SFF support

< > ServerWorks Frodo / Apple K2 SATA support

<*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support // Intel ICH,G系列chipset driver

< > Marvell SATA support

< > NVIDIA SATA support

< > Pacific Digital ADMA support

< > Pacific Digital SATA QStor support

< > Promise SATA TX2/TX4 support

< > Silicon Image SATA support

< > SiS 964/965/966/180 SATA support

< > ULi Electronics SATA support

< > VIA SATA support

< > VITESSE VSC-7174 / INTEL 31244 SATA support

< > Initio 162x SATA support

< > ACPI firmware driver for PATA

< > ALi PATA support

< > AMD/NVidia PATA support <=== 我用的是SATA,取消PATA支持

< > ARTOP 6210/6260 PATA support

< > ATI PATA support

< > CMD64x PATA support

< > CS5510/5520 PATA support

< > CS5530 PATA support

< > CS5536 PATA support

< > EFAR SLC90E66 support

< > Generic ATA support

< > HPT 366/368 PATA support

< > HPT 343/363 PATA support

< > IT8211/2 PATA support

< > JMicron PATA support

< > Compaq Triflex PATA support

< > Marvell PATA support via legacy mode

<> Intel PATA MPIIX support <=== 我用的是SATA,取消PATA支持

< > Intel PATA old PIIX support <=== 我用的是SATA,取消PATA支持

< > NETCELL Revolution RAID support

< > Nat Semi NS87410 PATA support

< > Nat Semi NS87415 PATA support

< > Older Promise PATA controller support

< > PC Tech RZ1000 PATA support

< > SC1200 PATA support

< > SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support

< > Promise PATA 2027x support

< > CMD / Silicon Image 680 PATA support

< > SiS PATA support

< > VIA PATA support

< > Winbond SL82C105 PATA support

< > Intel SCH PATA support <=== 我用的是SATA,取消PATA支持

[ ] Multiple devices driver support (RAID and LVM) ---> <=== 暫時沒有要使用Raid(磁盤陣列)和LVM(邏輯卷管理器,添加,刪除邏輯分區)的需求

[ ] Fusion MPT device support --->

IEEE 1394 (FireWire) support --->

< > I2O device support --->

[ ] Macintosh device drivers ---> <=== Mac系統硬件設備驅動,沒什麼好說的,關

[*] Network device support --->

< > Dummy net driver support

< > Bonding driver support

< > EQL (serial line load balancing) support

< > Universal TUN/TAP device driver support

< > Virtual ethernet pair device

< > General Instruments Surfboard 1000

< > ARCnet support --->

<> PHY Device support and infrastructure ---> <=== PHY (物理層控制芯片) ,裏面沒有我對應的硬件

[*] Ethernet (10 or 100Mbit) --->

-*- Generic Media Independent Interface device support

< > Sun Happy Meal 10/100baseT support

< > Sun GEM support

< > Sun Cassini support

[ ] 3COM cards <=== 我不是3COM網卡

[] "Tulip" family network device support ---> <=== 不是 Tulip 系列

< > HP 10/100VG PCLAN (ISA, EISA, PCI) support

[*] EISA, VLB, PCI and on board controllers

<*> AMD PCnet32 PCI support // 這是個人網卡驅動

< > AMD 8111 (new PCI lance) support

< > Adaptec Starfire/DuraLAN support

< > Broadcom 440x/47xx ethernet support

< > nForce Ethernet support <=== 不是 nForce 網卡

< > Intel(R) PRO/100+ support <=== 不是 Intel 網卡

< > Myson MTD-8xx PCI Ethernet support

< > National Semiconductor DP8381x series PCI Ethernet support

<> PCI NE2000 and clones support (see help) <=== 與NE2000無關

<> RealTek RTL-8129/8130/8139 PCI Fast Ethernet Adapter support <=== 不是 RealTek 網卡

[ ] Use PIO instead of MMIO

[ ] Support for uncommon RTL-8139 rev. K (automatic channel equalization)

[ ] Support for older RTL-8129/8130 boards

[ ] Use older RX-reset method

< > RDC R6040 Fast Ethernet Adapter support

< > SiS 900/7016 PCI Fast Ethernet Adapter support

< > SMC EtherPower II

< > SMSC LAN9420 PCI ethernet adapter support

< > Sundance Alta support

< > TI ThunderLAN support

< > Micrel KSZ8842

< > VIA Rhine support

< > Atheros L2 Fast Ethernet support

[] Ethernet (1000 Mbit) ---> <=== 若是你是千M卡,請自行選擇

[] Ethernet (10000 Mbit) ---> <=== 若是你是萬M卡,請自行選擇

<> Token Ring driver support ---> <=== IBM的令牌環網,用以太網的忽略

Wireless LAN --->

*** Enable WiMAX (Networking options) to see the WiMAX drivers ***

USB Network Adapters --->

[ ] Wan interfaces support --->

<> FDDI driver support <=== 光纖卡驅動,相信沒幾我的能用上這玩意

< > PPP (point-to-point protocol) support

< > SLIP (serial line) support

[ ] Fibre Channel driver support

[ ] ISDN support --->

< > Telephony support --->

Input device support --->

-*- Generic input layer (needed for keyboard, mouse, ...)

-*- Support for memoryless force-feedback devices

<> Polled input device skeleton <=== 一種週期性輪詢硬件狀態的驅動,去掉後沒什麼反作用

*** Userland interfaces ***

-*- Mouse interface

[ ] Provide legacy /dev/psaux device

(1024) Horizontal screen resolution

(768) Vertical screen resolution

< > Joystick interface

<> Event interface <=== 將輸入設備的事件存儲到/dev/input/eventX供應用程序讀取,沒相關需求

< > Event debugging

*** Input Device Drivers ***

-*- Keyboards --->

[] Mice ---> <=== 我是用純字符終端,若是你想用X window,請自行選擇

[] Joysticks/Gamepads ---> <=== 遊戲設備

[] Tablets ---> <=== 平板PC

[] Touchscreens ---> <=== 觸摸屏

[] Miscellaneous devices ---> <=== 雜七雜八的驅動,揚聲器,筆記本擴展按鍵等

Hardware I/O ports --->

Character devices --->

-*- Virtual terminal

[] Support for binding and unbinding console drivers // 在某些系統上可使用多個控制檯驅動程序(如framebuffer控制檯驅動程序),該選項使得你能夠選擇其中之一,我通常只用默認的虛擬終端

[] /dev/kmem virtual device support <=== 支持/dev/kmem設備,不多用

[] Non-standard serial port support <=== 我沒有非標準的串口設備

Serial drivers --->

< > 8250/16550 and compatible serial support <=== 兼容一些老式的串口設備,我通常不用

*** Non-8250 serial port support ***

< > Digi International NEO PCI Support

-*- Unix98 PTY support

[ ] Support multiple instances of devpts

[ ] Legacy (BSD) PTY support

< > IPMI top-level message handler --->

<*> Hardware Random Number Generator Core support

< > Timer IOMEM HW Random Number Generator support

<*> Intel HW Random Number Generator support

<> AMD HW Random Number Generator support <=== 我是intel主板

< > AMD Geode HW Random Number Generator support <=== 我是intel主板

<> VIA HW Random Number Generator support <=== 我是intel主板

<> /dev/nvram support <=== 直接存取CMOS,太危險,關

< > Siemens R3964 line discipline

< > Applicom intelligent fieldbus card support

< > ACP Modem (Mwave) support

< > NatSemi PC8736x GPIO Support

< > NatSemi Base GPIO Support

< > AMD CS5535/CS5536 GPIO (Geode Companion Device)

< > RAW driver (/dev/raw/rawN)

[*] HPET - High Precision Event Timer

[ ] Allow mmap of HPET

< > Hangcheck timer

-*- I2C support ---> // 感知硬件狀態,好比溫度,風扇轉速

[ ] SPI support --->

PPS support --->

[ ] GPIO Support --->

< > Dallas's 1-wire support --->

-*- Power supply class support --->

<*> Hardware Monitoring support --->

-*- Generic Thermal sysfs driver --->

[*] Watchdog Timer Support --->

Sonics Silicon Backplane --->

Multifunction device drivers --->

[ ] Voltage and Current Regulator Support --->

< > Multimedia support --->

Graphics support --->

<> /dev/agpgart (AGP Support) ---> <=== 用字符終端的忽略

<> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> <=== 用字符終端的忽略

<> Lowlevel video output switch controls <=== 用字符終端的忽略

<> Support for frame buffer devices ---> <=== 用字符終端的忽略

[] Backlight & LCD device support ---> <=== 用字符終端的忽略

Display device support --->

Console display driver support --->

[*] Enable Scrollback Buffer in System RAM

(64) Scrollback Buffer Size (in KB)

<> Sound card support ---> <=== 用不到聲卡

[] HID Devices ---> <=== 用不到人力工程學設備

[] USB support ---> <=== 這個選項,對於跑物理機建議開啓,由於有可能你的鍵盤是USB的,我是跑虛擬機的,因此關了

< > MMC/SD/SDIO card support --->

< > Sony MemoryStick card support (EXPERIMENTAL) --->

[] LED Support ---> <=== 發光二級管,應該是跟顯示器相關的驅動,因爲我運行的是虛擬機,因此我選擇關閉

[ ] Accessibility support --->

< > InfiniBand support --->

[*] EDAC (Error Detection And Correction) reporting ---> // 硬件故障repoting

<*> Real Time Clock --->

[*] DMA Engine support --->

[ ] Auxiliary Display support --->

< > Userspace I/O drivers --->

TI VLYNQ --->

[ ] Staging drivers --->

[] X86 Platform Specific Device Drivers ---> <=== 一些筆記本的驅動,我沒有相關設備

Firmware Drivers --->

< > BIOS Enhanced Disk Drive calls determine boot disk

< > BIOS update support for DELL systems via sysfs

< > Dell Systems Management Base Driver

[*] Export DMI identification via sysfs to userspace // 將BIOS裏的DMI區信息導出到用戶空間,部分系統管理工具可能會用到

[ ] iSCSI Boot Firmware Table Attributes

File systems --->

< > Second extended fs support

<> Ext3 journalling file system support <=== 我使用的是ext4 FS

<*> The Extended 4 (ext4) filesystem

[ ] Enable ext4dev compatibility

[*] Ext4 extended attributes

[*] Ext4 POSIX Access Control Lists

[] Ext4 Security Labels <=== 取消 SELinux 支持

[ ] JBD (ext3) debugging support

[ ] JBD2 (ext4) debugging support

< > Reiserfs support

< > JFS filesystem support

< > XFS filesystem support

< > OCFS2 file system support

[*] Dnotify support

[*] Inotify file change notification support

[*] Inotify support for userspace

[] Quota support <=== 磁盤配額支持,限制某個用戶或者某組用戶的磁盤佔用空間,暫時沒這個需求,你能夠把它編譯成模塊

< > Kernel automounter support

<*> Kernel automounter version 4 support (also supports v3) <=== 我沒有要掛載遠程文件系統的需求

< > FUSE (Filesystem in Userspace) support

Caches --->

CD-ROM/DVD Filesystems --->

<> ISO 9660 CDROM file system support <=== 在虛擬機內,我不用CDROM

< > UDF file system support

DOS/FAT/NT Filesystems --->

< > MSDOS fs support <=== 我沒有微軟fs的設備

< > VFAT (Windows-95) fs support <=== 我沒有微軟fs的設備

< > NTFS file system support

Pseudo filesystems --->

[] Miscellaneous filesystems ---> <=== 若是你沒有其餘FS的支持需求,關

[] Network File Systems ---> <=== 若是你沒有其餘NFS的支持需求,關

Partition Types --->

[ ] Advanced partition selection <=== 若是不是和其餘系統共存,能夠不選

-*- Native language support ---> // 選上Chinese

Kernel hacking --->

[] Show timing information on printks <=== 在printk的輸出中包含時間信息,能夠用來分析內核啓動過程各步驟所用時間 , 我不須要debug內核

[ ] Enable __deprecated logic

[*] Enable __must_check logic

(2048) Warn for stack frames larger than (needs gcc 4.4)

[] Magic SysRq key <=== 一種經過快捷鍵控制系統方式,除非你很是清楚這個選項,官方不推薦選擇

[ ] Enable unused/obsolete exported symbols

-*- Debug Filesystem

[ ] Run 'make headers_check' when building vmlinux

[] Kernel debugging <=== 內核調試,關

[ ] Enable SLUB performance statistics

[] Compile the kernel with frame pointers <=== 仍是跟內核開發有關

[ ] Delay each boot printk message by N milliseconds

< > torture tests for RCU

[ ] Check for stalled CPUs delaying RCU grace periods

< > Self test for the backtrace code

[ ] Force extended block device numbers and spread them

[ ] Fault-injection framework

[ ] Latency measuring infrastructure

[*] Sysctl checks

[] Tracers ---> <=== 內核跟蹤分析器

[] Remote debugging over FireWire early on boot <=== 啓動過程當中,容許遠程調試內核

[ ] Enable dynamic printk() support

[ ] Enable debugging of DMA-API usage

[ ] Sample kernel code --->

[ ] Filter access to /dev/mem

[] Enable verbose x86 bootup info messages <=== 在內核鏡像解壓縮階段輸出啓動信息,關閉後至關於無聲啓動(Slient Bootup)

-*- Early printk

[] Early printk via EHCI debug port <=== 容許printk經過EHCI調試端口輸出內核日誌,調試的一概關

[ ] Use 4Kb for kernel stacks instead of 8Kb

[ ] Enable IOMMU stress-test mode

IO delay type (port 0x80 based port-IO delay [recommended]) --->

[*] Allow gcc to uninline functions marked 'inline'

Security options ---> <=== 安全特性,我選擇全關,固然,這些選項不會影響你的平常開發,辦公

[] Enable access key retention support <=== 關閉

[] Enable different security models <=== 關閉

[ ] Enable the securityfs filesystem

[] File POSIX Capabilities <=== 關閉

[ ] Integrity Measurement Architecture(IMA)

<*> Cryptographic API ---> // 加密API,這部分選項會根據此前的優化自動調整,默認便可

[] Virtualization ---> <=== 個人系統已經運行在虛擬機中,不須要再支持虛擬化

Library routines ---> // 庫子程序,這部分選項會根據此前的優化自動調整,默認便可

相關文章
相關標籤/搜索