---
title: "Linux 2.6.31内核优化-2"
author: "loamy"
date: "2010-03-24T14:43:49Z"
tags: []
categories: ["操作系统"]
slug: "linux-2-6-31-2"
draft: false
lastmod: "2010-03-24T14:43:49Z"
id: 623647
url: "https://loamy.iteye.com/blog/623647"
---

**Device Drivers  ---&gt;**

Generic Driver Options  ---&gt;

(/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 &lt;=== 管理设备资源的冗长调试信息，我不需要

&lt;\*&gt; Connector - unified userspace &lt;-&gt; kernelspace linker  ---&gt;// 内核空间与用户空间的信道

\[\*]   Report process events to userspace // 报告处理时间给用户空间

&lt; &gt; Memory Technology Device (MTD) support  ---&gt;

&lt; &gt; Parallel port support  ---&gt;

-\*- Plug and Play support  ---&gt;

\[ ]   PNP debugging messages &lt;=== 调试信息，老规矩

\[ ] Block devices  ---&gt; &lt;=== 我没有想要支持的块设备，比如ramdisk, 磁盘阵列，CD/DVD刻录等，详见内部选项

\[ ] Misc devices  ---&gt; &lt;=== 没有需要支持的杂项设备

&lt; &gt; ATA/ATAPI/MFM/RLL support  ---&gt;

SCSI device support  ---&gt;

&lt; &gt; RAID Transport Class

-\*- SCSI device support

\[] legacy /proc/scsi/ support &lt;=== 我没有SCSI设备

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

&lt;\*&gt; SCSI disk support // 就算你用SATA，此选项也必选

&lt; &gt; SCSI tape support

&lt; &gt; SCSI OnStream SC-x0 tape support

&lt;&gt; SCSI CDROM support &lt;=== 我没有SCSI设备

&lt;&gt; SCSI generic support &lt;=== 我没有SCSI设备

&lt; &gt; SCSI media changer support

\[ ] Probe all LUNs on each SCSI device

\[] Verbose SCSI error reporting (kernel size +=12K) &lt;=== 我没有SCSI设备

\[ ] SCSI logging facility

\[ ] Asynchronous SCSI scanning

SCSI Transports  ---&gt;

&lt;&gt; Parallel SCSI (SPI) Transport Attributes &lt;=== 我没有SCSI设备

&lt; &gt; FiberChannel Transport Attributes

&lt; &gt; iSCSI Transport Attributes

&lt; &gt; SAS Domain Transport Attributes

&lt; &gt; SRP Transport Attributes

\[ ] SCSI low-level drivers  ---&gt;

&lt; &gt; SCSI Device Handlers  ---&gt;

&lt; &gt; OSD-Initiator library

Serial ATA (prod) and Parallel ATA (experimental) drivers  ---&gt;

\[\*]   ATA ACPI Support

\[ ]   SATA Port Multiplier support &lt;=== 我只有一枚SATA设备，没有使用 多路SATA/SATA Hub 的需求。Port Multiplier是南桥芯片提供的一种支持多块SATA设备，并共享总带宽的技术。

&lt;\*&gt;   AHCI SATA support

&lt; &gt;   Silicon Image 3124/3132 SATA support

\[\*]   ATA SFF support

&lt; &gt;     ServerWorks Frodo / Apple K2 SATA support

&lt;\*&gt;     Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support // Intel ICH，G系列chipset driver

&lt; &gt;     Marvell SATA support 

&lt; &gt;     NVIDIA SATA support  

&lt; &gt;     Pacific Digital ADMA support                  

&lt; &gt;     Pacific Digital SATA QStor support            

&lt; &gt;     Promise SATA TX2/TX4 support                  

&lt; &gt;     Silicon Image SATA support                    

&lt; &gt;     SiS 964/965/966/180 SATA support              

&lt; &gt;     ULi Electronics SATA support                  

&lt; &gt;     VIA SATA support     

&lt; &gt;     VITESSE VSC-7174 / INTEL 31244 SATA support   

&lt; &gt;     Initio 162x SATA support                      

&lt; &gt;     ACPI firmware driver for PATA                 

&lt; &gt;     ALi PATA support     

&lt; &gt;     AMD/NVidia PATA support &lt;=== 我用的是SATA，取消PATA支持

&lt; &gt;     ARTOP 6210/6260 PATA support                  

&lt; &gt;     ATI PATA support     

&lt; &gt;     CMD64x PATA support  

&lt; &gt;     CS5510/5520 PATA support                      

&lt; &gt;     CS5530 PATA support

&lt; &gt;     CS5536 PATA support                           

&lt; &gt;     EFAR SLC90E66 support                         

&lt; &gt;     Generic ATA support                           

&lt; &gt;     HPT 366/368 PATA support                      

&lt; &gt;     HPT 343/363 PATA support                      

&lt; &gt;     IT8211/2 PATA support                         

&lt; &gt;     JMicron PATA support                           

&lt; &gt;     Compaq Triflex PATA support                   

&lt; &gt;     Marvell PATA support via legacy mode          

&lt;&gt;     Intel PATA MPIIX support &lt;=== 我用的是SATA，取消PATA支持

&lt; &gt;     Intel PATA old PIIX support &lt;=== 我用的是SATA，取消PATA支持

&lt; &gt;     NETCELL Revolution RAID support               

&lt; &gt;     Nat Semi NS87410 PATA support                 

&lt; &gt;     Nat Semi NS87415 PATA support                 

&lt; &gt;     Older Promise PATA controller support         

&lt; &gt;     PC Tech RZ1000 PATA support                   

&lt; &gt;     SC1200 PATA support                           

&lt; &gt;     SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support

&lt; &gt;     Promise PATA 2027x support                    

&lt; &gt;     CMD / Silicon Image 680 PATA support          

&lt; &gt;     SiS PATA support                              

&lt; &gt;     VIA PATA support                              

&lt; &gt;     Winbond SL82C105 PATA support                 

&lt; &gt;     Intel SCH PATA support &lt;=== 我用的是SATA，取消PATA支持

\[ ] Multiple devices driver support (RAID and LVM)  ---&gt; &lt;=== 暂时没有要使用Raid（磁盘阵列）和LVM（逻辑卷管理器，添加，删除逻辑分区）的需求

\[ ] Fusion MPT device support  ---&gt;

IEEE 1394 (FireWire) support  ---&gt;

&lt; &gt; I2O device support  ---&gt;

\[ ] Macintosh device drivers  ---&gt; &lt;=== Mac系统硬件设备驱动，没什么好说的，关

\[\*] Network device support  ---&gt;

&lt; &gt;   Dummy net driver support                        

&lt; &gt;   Bonding driver support                          

&lt; &gt;   EQL (serial line load balancing) support        

&lt; &gt;   Universal TUN/TAP device driver support         

&lt; &gt;   Virtual ethernet pair device                    

&lt; &gt;   General Instruments Surfboard 1000              

&lt; &gt;   ARCnet support  ---&gt; 

&lt;&gt;   PHY Device support and infrastructure  ---&gt; &lt;=== PHY (物理层控制芯片)  ，里面没有我对应的硬件

\[\*]   Ethernet (10 or 100Mbit)  ---&gt;

-\*-   Generic Media Independent Interface device support

&lt; &gt;   Sun Happy Meal 10/100baseT support              

&lt; &gt;   Sun GEM support                                 

&lt; &gt;   Sun Cassini support                             

\[ ]   3COM cards &lt;=== 我不是3COM网卡

\[]   "Tulip" family network device support  ---&gt; &lt;=== 不是 Tulip 系列

&lt; &gt;   HP 10/100VG PCLAN (ISA, EISA, PCI) support      

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

&lt;\*&gt;     AMD PCnet32 PCI support  // 这是我的网卡驱动                     

&lt; &gt;     AMD 8111 (new PCI lance) support              

&lt; &gt;     Adaptec Starfire/DuraLAN support              

&lt; &gt;   Broadcom 440x/47xx ethernet support             

&lt; &gt;   nForce Ethernet support  &lt;=== 不是 nForce 网卡       

&lt; &gt;   Intel(R) PRO/100+ support  &lt;=== 不是 Intel 网卡            

&lt; &gt;   Myson MTD-8xx PCI Ethernet support              

&lt; &gt;   National Semiconductor DP8381x series PCI Ethernet support

&lt;&gt;   PCI NE2000 and clones support (see help) &lt;=== 与NE2000无关

&lt;&gt;   RealTek RTL-8129/8130/8139 PCI Fast Ethernet Adapter support &lt;=== 不是 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

&lt; &gt;   RDC R6040 Fast Ethernet Adapter support         

&lt; &gt;   SiS 900/7016 PCI Fast Ethernet Adapter support  

&lt; &gt;   SMC EtherPower II                               

&lt; &gt;   SMSC LAN9420 PCI ethernet adapter support       

&lt; &gt;   Sundance Alta support                            

&lt; &gt;   TI ThunderLAN support                           

&lt; &gt;   Micrel KSZ8842                                  

&lt; &gt;   VIA Rhine support                               

&lt; &gt;   Atheros L2 Fast Ethernet support

\[]   Ethernet (1000 Mbit)  ---&gt; &lt;=== 如果你是千M卡，请自行选择

\[]   Ethernet (10000 Mbit)  ---&gt; &lt;=== 如果你是万M卡，请自行选择

&lt;&gt;   Token Ring driver support  ---&gt; &lt;=== IBM的令牌环网，用以太网的忽略

      Wireless LAN  ---&gt;                              

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

      USB Network Adapters  ---&gt;                      

\[ ]   Wan interfaces support  ---&gt;                    

&lt;&gt;   FDDI driver support &lt;=== 光纤卡驱动，相信没几个人能用上这玩意

&lt; &gt;   PPP (point-to-point protocol) support           

&lt; &gt;   SLIP (serial line) support                      

\[ ]   Fibre Channel driver support

\[ ] ISDN support  ---&gt;       

&lt; &gt; Telephony support  ---&gt;  

Input device support  ---&gt;

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

-\*-   Support for memoryless force-feedback devices   

&lt;&gt;   Polled input device skeleton  &lt;=== 一种周期性轮询硬件状态的驱动，去掉后没什么副作用

      \*\** Userland interfaces \*\**                     

-\*-   Mouse interface

\[ ]     Provide legacy /dev/psaux device 

(1024)  Horizontal screen resolution                  

(768)   Vertical screen resolution                    

&lt; &gt;   Joystick interface                              

&lt;&gt;   Event interface  &lt;=== 将输入设备的事件存储到/dev/input/eventX供应用程序读取，没相关需求

&lt; &gt;   Event debugging                                 

      \*\** Input Device Drivers \*\**                    

-\*-   Keyboards  ---&gt;

\[]   Mice  ---&gt; &lt;=== 我是用纯字符终端，如果你想用X window，请自行选择                             

\[]   Joysticks/Gamepads  ---&gt;  &lt;=== 游戏设备

\[]   Tablets  ---&gt; &lt;=== 平板PC

\[]   Touchscreens  ---&gt;  &lt;=== 触摸屏

\[]   Miscellaneous devices  ---&gt; &lt;=== 杂七杂八的驱动，扬声器，笔记本扩展按键等

Hardware I/O ports  ---&gt;

Character devices  ---&gt; 

-\*- Virtual terminal         

\[]   Support for binding and unbinding console drivers // 在某些系统上可以使用多个控制台驱动程序(如framebuffer控制台驱动程序),该选项使得你可以选择其中之一 ，我一般只用默认的虚拟终端

\[] /dev/kmem virtual device support  &lt;=== 支持/dev/kmem设备，很少用    

\[] Non-standard serial port support  &lt;=== 我没有非标准的串口设备

 Serial drivers  ---&gt;

&lt; &gt; 8250/16550 and compatible serial support &lt;=== 兼容一些老式的串口设备，我一般不用

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

&lt; &gt; Digi International NEO PCI Support

-\*- Unix98 PTY support       

\[ ]   Support multiple instances of devpts            

\[ ] Legacy (BSD) PTY support 

&lt; &gt; IPMI top-level message handler  ---&gt;              

&lt;\*&gt; Hardware Random Number Generator Core support     

&lt; &gt;   Timer IOMEM HW Random Number Generator support  

&lt;\*&gt;   Intel HW Random Number Generator support    

&lt;&gt;   AMD HW Random Number Generator support  &lt;=== 我是intel主板

 &lt; &gt;   AMD Geode HW Random Number Generator support &lt;=== 我是intel主板

&lt;&gt;   VIA HW Random Number Generator support &lt;=== 我是intel主板    

&lt;&gt; /dev/nvram support  &lt;=== 直接存取CMOS，太危险，关

&lt; &gt; Siemens R3964 line discipline

&lt; &gt; Applicom intelligent fieldbus card support        

&lt; &gt; ACP Modem (Mwave) support

&lt; &gt; NatSemi PC8736x GPIO Support                      

&lt; &gt; NatSemi Base GPIO Support

&lt; &gt; AMD CS5535/CS5536 GPIO (Geode Companion Device)   

&lt; &gt; RAW driver (/dev/raw/rawN)

\[\*] HPET - High Precision Event Timer              

\[ ]   Allow mmap of HPET     

&lt; &gt; Hangcheck timer

-\*- I2C support  ---&gt; // 感知硬件状态，比如温度，风扇转速

\[ ] SPI support  ---&gt;        

    PPS support  ---&gt;        

\[ ] GPIO Support  ---&gt;       

&lt; &gt; Dallas's 1-wire support  ---&gt;                     

-\*- Power supply class support  ---&gt;                  

&lt;\*&gt; Hardware Monitoring support  ---&gt;      

-\*- Generic Thermal sysfs driver  ---&gt;                

\[\*] Watchdog Timer Support  ---&gt;                       

    Sonics Silicon Backplane  ---&gt;                    

    Multifunction device drivers  ---&gt;                

\[ ] Voltage and Current Regulator Support  ---&gt;       

&lt; &gt; Multimedia support  ---&gt; 

Graphics support  ---&gt;

&lt;&gt; /dev/agpgart (AGP Support)  ---&gt; &lt;=== 用字符终端的忽略            

&lt;&gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  ---&gt; &lt;=== 用字符终端的忽略

&lt;&gt; Lowlevel video output switch controls  &lt;=== 用字符终端的忽略

&lt;&gt; Support for frame buffer devices  ---&gt;  &lt;=== 用字符终端的忽略

\[] Backlight & LCD device support  ---&gt;  &lt;=== 用字符终端的忽略

    Display device support  ---&gt; 

    Console display driver support  ---&gt;  

\[\*]   Enable Scrollback Buffer in System RAM

(64)    Scrollback Buffer Size (in KB)

&lt;&gt; Sound card support  ---&gt;  &lt;=== 用不到声卡

\[] HID Devices  ---&gt;  &lt;=== 用不到人力工程学设备

\[] USB support  ---&gt;  &lt;=== 这个选项，对于跑物理机建议开启，因为有可能你的键盘是USB的，我是跑虚拟机的，所以关了

&lt; &gt; MMC/SD/SDIO card support  ---&gt;  

&lt; &gt; Sony MemoryStick card support (EXPERIMENTAL)  ---&gt;

\[] LED Support  ---&gt;  &lt;=== 发光二级管，应该是跟显示器相关的驱动，由于我运行的是虚拟机，所以我选择关闭

\[ ] Accessibility support  ---&gt;

&lt; &gt; InfiniBand support  ---&gt; 

\[\*] EDAC (Error Detection And Correction) reporting  ---&gt; // 硬件故障repoting

&lt;\*&gt; Real Time Clock  ---&gt;

\[\*] DMA Engine support  ---&gt; 

\[ ] Auxiliary Display support  ---&gt;                   

&lt; &gt; Userspace I/O drivers  ---&gt;                       

    TI VLYNQ  ---&gt;           

\[ ] Staging drivers  ---&gt;    

\[] X86 Platform Specific Device Drivers  ---&gt; &lt;=== 一些笔记本的驱动，我没有相关设备

 

**Firmware Drivers  ---&gt;**

&lt; &gt; BIOS Enhanced Disk Drive calls determine boot disk

&lt; &gt; BIOS update support for DELL systems via sysfs    

&lt; &gt; Dell Systems Management Base Driver               

\[\*] Export DMI identification via sysfs to userspace   // 将BIOS里的DMI区信息导出到用户空间，部分系统管理工具可能会用到

\[ ] iSCSI Boot Firmware Table Attributes

 

**File systems  ---&gt;**

&lt; &gt; Second extended fs support

&lt;&gt; Ext3 journalling file system support &lt;=== 我使用的是ext4 FS

&lt;\*&gt; The Extended 4 (ext4) filesystem

\[ ]   Enable ext4dev compatibility                    

\[\*]   Ext4 extended attributes

\[\*]     Ext4 POSIX Access Control Lists

\[]     Ext4 Security Labels  &lt;=== 取消 SELinux 支持

\[ ] JBD (ext3) debugging support

\[ ] JBD2 (ext4) debugging support                     

&lt; &gt; Reiserfs support         

&lt; &gt; JFS filesystem support   

&lt; &gt; XFS filesystem support   

&lt; &gt; OCFS2 file system support

\[\*] Dnotify support          

\[\*] Inotify file change notification support          

\[\*] Inotify support for userspace                     

\[] Quota support &lt;=== 磁盘配额支持,限制某个用户或者某组用户的磁盘占用空间，暂时没这个需求，你可以把它编译成模块

&lt; &gt; Kernel automounter support

&lt;\*&gt; Kernel automounter version 4 support (also supports v3)  &lt;=== 我没有要挂载远程文件系统的需求

&lt; &gt; FUSE (Filesystem in Userspace) support

    Caches  ---&gt; 

    CD-ROM/DVD Filesystems  ---&gt; 

&lt;&gt; ISO 9660 CDROM file system support  &lt;=== 在虚拟机内，我不用CDROM              

&lt; &gt; UDF file system support

    DOS/FAT/NT Filesystems  ---&gt;

&lt; &gt; MSDOS fs support &lt;=== 我没有微软fs的设备

&lt; &gt; VFAT (Windows-95) fs support  &lt;=== 我没有微软fs的设备

&lt; &gt; NTFS file system support

    Pseudo filesystems  ---&gt; 

\[] Miscellaneous filesystems  ---&gt; &lt;=== 如果你没有其他FS的支持需求，关

\[] Network File Systems  ---&gt; &lt;=== 如果你没有其他NFS的支持需求，关

    Partition Types  ---&gt;    

\[ ] Advanced partition selection &lt;=== 如果不是和其他系统共存，可以不选

-\*- Native language support  ---&gt; // 选上Chinese

 

**Kernel hacking  ---&gt;**

\[] Show timing information on printks  &lt;=== 在printk的输出中包含时间信息,可以用来分析内核启动过程各步骤所用时间 , 我不需要debug内核

\[ ] Enable \_\_deprecated logic                         

\[\*] Enable \_\_must\_check logic                         

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

\[] Magic SysRq key &lt;=== 一种通过快捷键控制系统方式，除非你非常清楚这个选项，官方不推荐选择

\[ ] Enable unused/obsolete exported symbols           

-\*- Debug Filesystem

\[ ] Run 'make headers\_check' when building vmlinux    

\[] Kernel debugging &lt;=== 内核调试，关                    

\[ ] Enable SLUB performance statistics                                                                           

\[] Compile the kernel with frame pointers  &lt;=== 还是跟内核开发有关

\[ ] Delay each boot printk message by N milliseconds  

&lt; &gt; torture tests for RCU                             

\[ ] Check for stalled CPUs delaying RCU grace periods 

&lt; &gt; Self test for the backtrace code                  

\[ ] Force extended block device numbers and spread them

\[ ] Fault-injection framework                          

\[ ] Latency measuring infrastructure                  

\[\*] Sysctl checks

\[] Tracers  ---&gt; &lt;=== 内核跟踪分析器

\[] Remote debugging over FireWire early on boot  &lt;=== 启动过程中，允许远程调试内核

\[ ] Enable dynamic printk() support

\[ ] Enable debugging of DMA-API usage

\[ ] Sample kernel code  ---&gt;                          

\[ ] Filter access to /dev/mem

\[] Enable verbose x86 bootup info messages &lt;=== 在内核镜像解压缩阶段输出启动信息，关闭后相当于无声启动(Slient Bootup)

-\*- Early printk 

\[]   Early printk via EHCI debug port  &lt;=== 允许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])  ---&gt;  

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

 

**Security options  ---&gt;**  &lt;=== 安全特性，我选择全关，当然，这些选项不会影响你的日常开发，办公

\[] Enable access key retention support &lt;=== 关闭

\[] Enable different security models &lt;=== 关闭

\[ ] Enable the securityfs filesystem

\[] File POSIX Capabilities &lt;=== 关闭

\[ ] Integrity Measurement Architecture(IMA)

 

**&lt;\*&gt; Cryptographic API  ---&gt;** // 加密API，这部分选项会根据此前的优化自动调整，默认即可

**\[] Virtualization  ---&gt;** &lt;=== 我的系统已经运行在虚拟机中，不需要再支持虚拟化

**Library routines  ---&gt;** // 库子程序，这部分选项会根据此前的优化自动调整，默认即可