IT/Kernel

Linux Kernel Configuration Guide

싸후이 2010. 6. 16. 14:06

SATA disks are SCSI

Most modern desktop systems ship with storage devices (hard disk and CD/DVD drives) on a Serial ATA bus, rather than the older IDE (ribbon cable) bus type.

SATA support in Linux is implemented in a layer referred to as libata, which sits below the SCSI subsystem. For this reason, SATA drivers are found in the SCSI driver section of the configuration. Additionally, your storage devices will be treated as SCSI devices, which means SCSI disk/cdrom support is required too. Your SATA hard disk will be named as (e.g.) /dev/sda and your SATA CD/DVD drive will be named as (e.g.) /dev/sr0.

Although the majority of these drivers are for SATA controllers, libata was not designed to be SATA-specific. All common IDE drivers will also be ported to libata in the near future, and at this point, the above considerations will also apply for IDE users.

Code Listing 3.1: Configuration options for libata

Device Drivers  --->
 SCSI device support  --->
  <*> SCSI device support
  <*>   SCSI disk support
  <*>   SCSI CDROM support

  SCSI low-level drivers  --->
   <*> Serial ATA (SATA) support
    Select your chipset from the choices listed below the above option

IDE chipsets and DMA

Despite the introduction of SATA, IDE devices are still very common and depended upon by many. IDE is a fairly generic technology, and as such, Linux supports almost all IDE controllers out-of-the-box without any controller-specific options selected.

However, IDE is an old technology, and in it's original Programmed Input/Output incarnation, it is unable to provide the transfer rates required for speedy access to modern storage devices. The generic IDE driver is limited to these PIO transfer modes, which result in slow data transfer rates, and significantly high CPU usage while data is being transferred to/from disk.

Unless you're dealing with a pre-1995 system, your IDE controller will also support an alternative transfer mode, known as Direct Memory Access (DMA). DMA is much much faster, and CPU utilisation is barely affected while data transfers are taking place. If you are suffering from really poor general system performance and you are using an IDE disk, chances are that DMA is not being used.

Note: As mentioned earlier, libata is available even for IDE drives. If you're using libata, then all your drives, including your IDE drives, will be using DMA. There's no need to do any further checking or configuration.

If you're not using libata for your IDE disks, then you'll need to check for DMA usage and enable it.

Code Listing 3.2: Checking if DMA is enabled on your IDE disk

# hdparm -d /dev/hda

/dev/hda:
 using_dma    =  0 (off)

To enable DMA on your IDE devices, you simply need to enable the configuration option for your IDE controller.

Code Listing 3.3: Configuration options for IDE controllers

Device Drivers  --->
 ATA/ATAPI/MFM/RLL support  --->
  <*> ATA/ATAPI/MFM/RLL support
  <*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
  [*]     PCI IDE chipset support
  Select your chipset from the choices listed below the above option

USB Host Controllers

USB is a widely adopted bus for connecting external peripherals to your computer. One of the reasons behind the success of USB is that it is a standardised protocol, however the USB host controller devices (HCDs) implemented on the host computer do vary a little. There are 3 main types:

  • UHCI is the Universal Host Controller Interface. It supports USB 1.1, and is usually found on motherboards based on a VIA or Intel chipset.
  • OHCI is the Open Host Controller Interface. It supports USB 1.1 and is usually found on motherboards based on an Nvidia or SiS chipset.
  • EHCI is the Extended Host Controller Interface. It is the only common host controller to support USB 2.0, and can typically be found on any computer that supports USB 2.0.

Most systems will come with two of the above interface types: EHCI (USB 2.0), plus either UHCI or OHCI (USB 1.1). It is important that you select both types present on your system. While all USB 2.0 devices are backwards compatible with USB 1.1, a large proportion of USB devices (even the ones being manufactured today) are based on the USB 1.1 interface - why would a USB mouse need more than 1.5mbit/sec?

If you do not select the relevant options corresponding to the USB HCD types present on your system, you may experience 'dead' USB ports: you plug a device in, but it does not get power or respond in any way.

A neat lspci trick (from the sys-apps/pciutils package) makes it relatively easy to detect which HCDs are present in your system. Ignoring the FireWire controller which was also matched, it is easy to spot that my system requires OHCI and EHCI support:

Code Listing 3.4: Using lspci to detect HCD type

# lspci -v | grep HCI
00:02.0 USB Controller: nVidia Corporation CK804 USB Controller (rev a2) (prog-if 10 [OHCI])
00:02.1 USB Controller: nVidia Corporation CK804 USB Controller (rev a3) (prog-if 20 [EHCI])
01:0b.0 FireWire (IEEE 1394): Agere Systems FW323 (rev 61) (prog-if 10 [OHCI])

Code Listing 3.5: Configuration for USB HCDs

Device Drivers  --->
 USB support  --->
  <*> Support for Host-side USB
  ---   USB Host Controller Drivers
  <*>   EHCI HCD (USB 2.0) support
  <*>   OHCI HCD support
  <*>   UHCI HCD (most Intel and VIA) support
  Select the HCDs present on your system, or all 3 if you are unsure.

Multiprocessor, Hyper-Threading and Dual Core systems

Many computer systems are based on multiple processors, but not always in immediately obvious ways.

  • Many of Intel's CPUs support a technology which they call hyper-threading, which is where the CPU is actually viewed by the system as two logicalprocessors.
  • Some of the most recent Intel/AMD CPUs actually consist of multiple physical processors inside a single package, these are known as dual coreprocessors.
  • Some high-end computer systems actually have multiple physical processors installed on specialised motherboards to provide a significant performance increase over a uniprocessor system. You'll probably know if you have such a system, since they aren't cheap.

In all of these cases, you need to select the appropriate kernel options to obtain optimum performance from these setups.

Code Listing 3.6: Configuration for multi-processing

Processor type and features  --->
 [*] Symmetric multi-processing support
 Select the above option if you are on a multi-processor system (of any type)
 [*]   SMT (Hyperthreading) scheduler support
 Select the above option if you are on an Intel Hyper-Threading CPU
 [*]   Multi-core scheduler support (NEW)
 Select the above option if your CPU is dual core
Power management and ACPI options  --->
 [*] ACPI (Advanced Configuration and Power Interface) Support
 The above option not only enables power management features, but might
 also be a requirement for making all CPUs available to your system

x86 High Memory support

Due to limitations in the 32-bit address space of the x86 architecture, a kernel with default configuration can only support up to 896mb RAM. If your system has more memory, only the first 896mb will be visible, unless you enable high memory support.

Note: This limitation is specific to the x86 (IA32) architecture. Other architectures naturally support large amounts of memory, with no configuration tweaks required.

High memory support is not enabled by default, because it introduces a small system overhead. Do not be distracted by this, the overhead is insignificant when compared to the performance increase of having more memory available!

Code Listing 3.7: Enabling high memory support on x86

Processor type and features  --->
 High Memory Support  --->
  (X) 4GB
  ( ) 64GB
  Choose the 4GB option, unless your system has more than 4GB of RAM.


'IT > Kernel' 카테고리의 다른 글

커널 헤더 참고  (0) 2011.07.18
linux kernel 옵션  (0) 2009.07.22
커널 2.6 옵션 설정  (0) 2007.02.26
네트워크 서브 시스템  (0) 2007.02.26
커널 빌드·부팅 과정 분석  (0) 2007.02.26