Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to upgrade the linux-2.6 kernel

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to upgrade the linux-2.6 kernel". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to upgrade the linux-2.6 kernel".

One, 01. Module subsystem (Module Subsystem), unified device model (Unified Device Model), and PnP support

Significant changes have taken place in the module subsystem.

02. Stability has been improved.

In order to completely avoid the kernel loading or exporting the kernel module being used, or at least to reduce the possibility of using the module while loading or unloading the module

(this sometimes leads to system crashes.) the process of kernel loading and exporting kernel modules has been improved.

03. Unified equipment model

The creation of a unified device model is one of the most important changes in the 2.6 kernel. It promotes the standardization of module interfaces with the aim of better controlling and managing devices, such as:

Determine the system equipment more accurately.

Power management and equipment power status.

Improved system bus structure management.

04. Plug and play (PnP) support

The changes mentioned in sections 1.1.1 and 1.1.2 make Linux running the 2.6 kernel a true plug-and-play OS.

For example, PnP support for ISA PnP extensions, legacy MCA and EISA buses, and hot-plug devices.

05. Changes in kernel infrastructure

In order to distinguish regular object files with the .o extension, the kernel module now uses the .ko extension.

A new sysfs file system is created and will be described when the kernel discovers the device tree.

Memory support, NUMA support

Support for a larger number of RAM

The kernel supports a larger number of RAM, up to 64GB in paging mode.

06.NUMA

Support for non-consistent kernel access (Non-Uniform Memory Access-NUMA) systems is new in the 2.6 kernel.

07. Threading model, NPTL

As opposed to LinuxThreads in v2.4, what is new in version 2.6 is NPTL (Native POSIX Threading Library).

NPTL brings enterprise-class threading support to Linux, providing far more performance than LinuxThreads. It is based on a user-to-kernel thread ratio of 1:1.

In October 2003, NPTL support was incorporated into the GNU C library glibc, and Red Hat took the lead in Red Hat Linux 9 and

NPTL is implemented in Red Hat Enterprise Linux using a custom v2.4 kernel.

08. Performance improvement

New Scheduler algorithm

The 2.6 Linux kernel introduces a new O (1) algorithm. It runs very well under high load. The new scheduler distributes time slices on a per-CPU basis

This eliminates global synchronization and reallocation loops, thereby improving performance.

Kernel preemption (Kernel Preemption)

The new 2.6 kernel is preemptive. This will significantly improve the performance of interactive and multimedia applications.

Performance improvement of IPUBO

Significant changes have also taken place in Linux's I _ map O subsystem, which is modified to ensure that no process stays in the queue for too long to perform input / output operations.

This makes the response of the Imax O operation more rapid.

Fast user Space Mutual exclusion (Fast User-Space Mutexes)

"futexes" (fast user space mutex) can serialize threads to avoid race conditions, and the introduction of it also improves response speed.

Improvements are achieved by partially implementing "futexes" in kernel space to allow the priority of waiting tasks to be set based on competition.

09. Scalability improvement

More processors

The Linux kernel 2.6 can support up to 64 CPU. More memory is supported, thanks to PAE (physical address extension, Physical Address Extensions), the memory supported in paging mode on 32-bit systems has been increased to 64GB.

Users and groups

The number of unique users and groups increased from 65000 to more than 4 billion, that is, from 16-bits to 32-bits.

Number of PID

The maximum number of PID increased from 32000 to 1 billion.

Number of open file descriptors

The number of open file descriptors has not increased, but you no longer need to set this parameter in advance, it will adjust itself.

10. Support more Devic

Prior to Linux kernel 2.6, there were restrictions in the kernel that could constrain large systems, such as 256 devices per chain. The v2.6 kernel completely breaks these restrictions.

It can not only support more types of devices, but also support more devices of the same type. In Linux 2.6 systems, 4095 major device types can be supported

Each individual type can have more than one million sub-devices.

File system Siz

The maximum addressable file system size allowed by the Linux kernel 2.6 is 16 TB.

11. File system

Traditional Linux file systems such as ext2, ext3, and ReiserFS have been significantly improved. The most noteworthy improvement is the introduction of extended attributes (or file metadata).

The most important thing is the implementation of POSIX ACL, which is an extension of ordinary UNIX permissions to support more detailed user access control.

twelve。 In addition to the improved support for the traditional Linux file system, the new kernel fully supports the relatively new XFS file system in Linux.

The Linux 2.6 kernel now also introduces improved support for the NTFS file system, which now allows NTFS file systems to be mounted in read / write mode.

Based on the new features of above 2.6, I decided to use 2.6 kernel and my system is Red Hat Enterprise Linux AS release 3 (Taroon Update 3).

The hardware environment is DELL 2850

Download and unzip and patch the kernel

I take 2.6.10 as an example, and patche uses bk4 as an example, just to let you know how to play patch.

In fact, I use 2.6.6 kernel because I upgraded to 2.6.9 kernel on AS3.0.

When mount has a large nfs network hard disk, the df display is incorrect. Obviously, the 800G disk becomes 4.2g.

But it still works. The packages I upgraded to nfs and mount are useless. / var/log/message

The prompt is kernel: nfs warning: mount version older than kernel

I hope those who know will let me know, thank you:) the kernel of BTW:2.6.8 has not been used.

Kernel source code: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.bz2

The latest kernel patch: http://www.kernel.org/pub/linux/. Atch-2.6.10-bk4.bz2

Cd / usr/src

Rm-rf linux

Tar jxf / download/linux-2.6.10.tar.bz2

Ln-s linux-2.6.10 linux

Cd linux

Bunzip2-dv / download/patch-2.6.10-bk4.bz2 | patch- p1

Use patch-p0 if you are in the / usr/src directory

Second, modify the kernel source code (upgrade 2.6 is for optimization, simply change the source code)

1. Modify / usr/src/linux/include/linux/posix_types.h

Set the maximum number supported by fd_set

# define _ FD_SETSIZE 1024->; 65536

two。 Modify / usr/src/linux/include/linux/fs.h

Set the maximum number of open files (number of TCP connections)

# define INR_OPEN 1024->; 65536

# define NR_FILE 8192->; 65536

# define NR_RESERVED_FILES 10-- >; 128

3. Modify / usr/src/linux/include/net/tcp.h

Set the time of TIMEOUT to 1 second

# define TCP_TIMEWAIT_LEN (60*HZ) 60->; 1*HZ

The number of retries for semi-connections set in the backlog queue takes a corresponding time each time, which in essence reduces the retry time.

# define TCP_SYNACK_RETRIES 5->; 3

RHEL-AS3 is inherently stable + optimized, but even if you use RHEL-AS3 's own kernel, you need to modify the above parameters:)

Third, install the necessary tools

1. Download module-init-tools-3.1.tar.bz2

Http://www.kernel.org/pub/linux/... T-tools-3.1.tar.bz2

[Copy to clipboard] [-] CODE:. / configure-- prefix=/

Make moveold

Make all install

. / generate-modprobe.conf / etc/modprobe.conf

two。 Download the new mkinitrd

Ftp://195.220.108.108/linux/6/fe... D-4.1.18-2.i386.rpm

It needs lvm2 device-mapper.

Ftp://195.220.108.108/linux/6/fe...-1.00.19-2.i386.rpm

Ftp://195.220.108.108/linux/6/fe... 00.25-1.01.i386.rpm

If you do not update this package, you will get the following error when you make install:

[Copy to clipboard] [-] CODE: No module mptbase found for kernel 2.6.10-bk4, aborting.

Mkinitrd failed

Make [1]: * * [install] Error 1

Make: * * [install] Error 2

Use rpm-ivh-- nodeps package name when installing lvm2-2.00.25-1.01.i386.rpm

IV. Make menuconfig

[Copy to clipboard] [-] CODE: 01.Code maturity level options-- >

[*] Prompt for development and/or incomplete code/drivers

[*] Select only drivers expected to compile cleanly

02.General setup->

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

[*] System V IPC

[*] POSIX Message Queues

[] BSD Process Accounting

[*] Sysctl support

[] Auditing support

[] Support for hot-pluggable devices

[*] Kernel Userspace Events

[] Kernel .config support

Configure standard kernel features (for small systems)->

[*] Load all symbols for debugging/kksymoops

[] Do an extra kallsyms pass

[*] Enable futex support

[*] Enable eventpoll support

[] Optimize for size

[*] Use full shmem filesystem

03.Loadable module support->

[*] Enable loadable module support

[*] Module unloading

[] Forced module unloading

[] Module versioning support (EXPERIMENTAL)

[] Source checksum for all modules

[*] Automatic kernel module loading

04.Processor type and features->

Subarchitecture Type (PC-compatible)->

Processor family (Pentium-4/Celeron (P4-based) / Pentium-4 M/Xeon)->

[*] Generic x86 support

[] HPET Timer Support

[*] Symmetric multi-processing support multiple CPU

(8) Maximum number of CPUs

[*] SMT (Hyperthreading) scheduler support

[*] Preemptible Kernel preemptive kernel, please select it

[] Machine Check Exception

< >

; Toshiba Laptop support

< >

; Dell laptop support

< >

; / dev/cpu/microcode-Intel IA32 CPU microcode support

< >

; / dev/cpu/*/msr-Model-specific register support

< >

; / dev/cpu/*/cpuid-CPU information support

Firmware Drivers->

High Memory Support (4GB)-- >; High memory

[] Allocate 3rd-level pagetables from highmem

[] Math emulation

[*] MTRR (Memory Type Range Register) support

[*] Enable kernel irq balancing

[] Use register arguments (EXPERIMENTAL)

05.Power management options (ACPI, APM)->; Power management customization (I do not choose)

06.Bus options (PCI, PCMCIA, EISA, MCA, ISA)->; the board supports customization

[*] PCI support

PCI access mode (Any)->

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

[*] Legacy / proc/pci interface

[*] PCI device name database

[] ISA support

[] MCA support

< >

; NatSemi SCx200 support

07.Executable file formats->

[*] Kernel support for ELF binaries

; Kernel support for a.out and ECOFF binaries

; Kernel support for MISC binaries

08.Device Drivers->; device driver and network support

Generic Driver Options->; default

[*] Select only drivers that don't need compile-time external firmware

[*] Prevent firmware from being built

Memory Technology Devices (MTD)->; not selected

Parallel port support-- >; custom parallel port (not selected by me)

Plug and Play support->; supports hot-swappable customization (I don't have a choice)

Block devices->

; Normal floppy disk support

< >

; Compaq SMART2 support

< >

; Compaq Smart Array 5xxx support

< >

; Mylex DAC960/DAC1100 PCI RAID Controller support

< >

; Micro Memory MM5415 Battery Backed RAM support (EXPERIMENTAL)

; Loopback device support

< >

; Cryptoloop Support

; Network block device support

< >

; Promise SATA SX8 support

; RAM disk support

(16) Default number of RAM disks

(4096) Default RAM disk size (kbytes)

() Source directory of cpio_list

[] Support for Large Block Devices

< >

; Packet writing on CD/DVD media

IO Schedulers->; IO scheduler, you can specify which way to schedule with IO in grub.conf, which will be discussed later.

; Anticipatory I Dot O scheduler

; Deadline I Dot O scheduler

; CFQ I Dot O scheduler

ATA/ATAPI/MFM/RLL support-- >; ATA device customization (not selected by me)

SCSI device support-- >; SCSI device Custom I have a scsi device, so I have the following options

; SCSI device support

[*] legacy / proc/scsi/ support

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

; SCSI disk support

Because of the SCSI of even MPT, the following is not selected. Omit it.

Multi-device support (RAID and LVM)->; supports RAID and LVM (logical volumes) customization

[*] Multiple devices driver support (RAID and LVM)

; RAID support

< >

; Linear (append) mode

; RAID-0 (striping) mode

< >

; RAID-1 (mirroring) mode

< >

; RAID-10 (mirrored striping) mode (EXPERIMENTAL)

; RAID-4/RAID-5 mode

< >

; RAID-6 mode (EXPERIMENTAL)

; Multipath I Dot O support

< >

; Faulty test module for MD

; Device mapper support

< >

; Crypt target support

< >

; Snapshot target (EXPERIMENTAL)

< >

; Mirror target (EXPERIMENTAL)

< >

; Zero target (EXPERIMENTAL)

Fusion MPT device support-- >; my SCSI is this, so choose it or customize it.

; Fusion MPT (base + ScsiHost) drivers

(40) Maximum number of scatter gather entries

; Fusion MPT misc device (ioctl) driver

IEEE 1394 (FireWire) support->; Custom (not selected by me)

I2O device support->; Custom (I don't have a choice)

Networking support->; Network options

[*] Networking support

Networking options->

; Packet socket

[] Packet socket: mmapped IO

< >

; Netlink device emulation

Unix domain sockets if you have a network, choose.

< >

; PF_KEY sockets

[*] TCP/IP networking

[] IP: multicasting

[] IP: advanced router

[] IP: kernel level autoconfiguration

< >

; IP: tunneling

< >

; IP: GRE tunnels over IP

[] IP: ARP daemon support (EXPERIMENTAL)

[*] IP: TCP syncookie support (disabled per default) can protect against DOS attacks, but it will degrade the performance a little. Generally speaking, the ratio of performance to price is good.

< >

; IP: AH transformation

< >

; IP: ESP transformation

< >

; IP: IPComp transformation

< >

; IP: tunnel transformation

; IP: TCP socket monitoring interface

IP: Virtual Server Configuration->; lvs support

< >

; The IPv6 protocol (EXPERIMENTAL)

[*] Network packet filtering (replaces ipchains)->; packet filtering omitted (choose those you know and those you are not familiar with)

None of the following is selected, omitted

[] Amateur Radio support->

< >

; IrDA (infrared) subsystem support->

< >

; Bluetooth subsystem support-- >

[*] Network device support

< >

Dummy net driver support this is from the nis server, I'm not sure, but I haven't used it.

; bound by Bonding driver support dual network cards

< >

; EQL (serial line load balancing) support

< >

; Universal TUN/TAP device driver support

ARCnet devices->

Ethernet (10 or 100Mbit)->

Ethernet (1000 Mbit)->

< >

; Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support

< >

; D-Link DL2000-based Gigabit Ethernet support

< >

; Intel (R) PRO/1000 Gigabit Ethernet support

< >

; National Semiconduct DP83820 support

< >

; Packet Engines Hamachi GNIC-II support

< >

; Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)

< >

; Realtek 8169 gigabit ethernet support

< >

; Marvell Yukon Chipset / SysKonnect SK-98xx Support

; Broadcom Tigon3 support

None of the following is selected, omitted

ISDN subsystem->

Telephony Support->

Input device support->

Character devices->

I2C support->

Dallas's 1-wire bus->

Misc devices->

Multimedia devices->

Graphics support->

Sound->

USB support->

MMC/SD Card support-- >; do not choose any of the above, choose what you need.

09.File systems->; file system

< >

; Second extended fs support

; Ext3 journalling file system support

[] Ext3 extended attributes

[*] JBD (ext3) debugging support

< >

; Reiserfs support

< >

; JFS filesystem support

< >

; XFS filesystem support

< >

; Minix fs support

< >

; ROM file system support

[] Quota support

< >

; Kernel automounter support

; Kernel automounter version 4 support (also supports v3)

CD-ROM/DVD Filesystems->

; ISO 9660 CDROM file system support

[] Microsoft Joliet CDROM extensions

[] Transparent decompression extension

< >

; UDF file system support

DOS/FAT/NT Filesystems-- >; the file format to be used by floppy

; MSDOS fs support

; VFAT (Windows-95) fs support

Default codepage for FAT (NEW)

(iso8859-1) Default iocharset for FAT (NEW)

< >

; NTFS file system support

Pseudo filesystems->

[*] / proc file system support proc file system support

[] / proc/kcore support

[] / dev file system support (OBSOLETE)

[] / dev/pts Extended Attributes

[*] Virtual memory file system support (former shm fs) virtual memory support

[] tmpfs Extended Attributes

[] HugeTLB file system support

Miscellaneous filesystems->

Network File Systems->

; NFS file system support nfs client support

[*] Provide NFSv3 client support

[] Provide NFSv4 client support (EXPERIMENTAL)

[] Allow direct Imax O on NFS files (EXPERIMENTAL)

< >

; NFS server support nfs server support

< >

; Secure RPC: Kerberos V mechanism (EXPERIMENTAL)

< >

; Secure RPC: SPKM3 mechanism (EXPERIMENTAL)

< >

; SMB file system support (to mount Windows shares etc.) Samba support

< >

; CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)

< >

; NCP file system support (to mount NetWare volumes)

< >

; Coda file system support (advanced network fs)

< >

; Andrew File System support (AFS) (Experimental)

Partition Types->

Native Language Support->; choose yourself

10.Profiling support->; not selected

11.Kernel hacking->; not selected

12.Security options->; not selected

13.Cryptographic options->; not selected

14.Library routines->

< >

; CRC-CCITT functions

; CRC32 functions

; CRC32c (Castagnoli, et al) Cyclic Redundancy-Check

5. Compilation and installation

Step: make-jn (n stands for simultaneous compilation process, can speed up the compilation speed, n depends on your configuration, my configuration uses 15-25)

Make modules_install

Make install

VI. Setting of grub

Before setting up, let's introduce 2.6's Igamo scheduler.

The four No-op O schedulers included in this article are scheduler O scheduler, Anticipatory O scheduler, Deadline O scheduler and CFQ O scheduler.

They are referred to as ns, as, ds and cfq respectively.

Ns is a simplified scheduler that does only the most basic merging and sorting. It doesn't have much to do with desktop systems, and it's mainly used in some special software.

In the hardware environment, these software and hardware generally have their own scheduling mechanism, which requires little kernel support, which is very suitable for some embedded system environments. As desktop users, we don't usually choose it.

As is the default Imax O scheduler in the current kernel. It has very good performance, and it attracted quite a lot of attention in 2.5. In comparison tests with the 2.4 kernel, several items in 2.4 are measured in minutes.

The completed task is completed in seconds. Because of this, it has become the default Imax O scheduler in the current 2.6 beta. But it also has its weakness, and it is relatively large and complex.

In some special cases, especially in the database system with very large data throughput, it will become slower.

Ds is to improve the shortcomings of as, is still in the testing stage, but has been very stable. The performance shown so far is almost as good as as. Plus, it's smaller than as.

It is a promising scheduler and is worth a try:)

Cfq allocates the same bandwidth to all tasks in the system, providing a fair working environment, which is more suitable for the desktop environment. In fact, it also performed well in the test.

Multimedia players such as mplayer xmms work well with it, and playback smoothing almost does not skip frames due to access to the disk. For those who like listening to music and watching movies under Linux, you might as well give it a try.

All right, let's talk about how to set it: the format of the parameter is the elevator= scheduler name.

Modify / boot/grub/grub.conf and add elevator=deadline at the back door of kernel.

For example: kernel / boot/vmlinuz-2.6.10-bk4 ro root=/dev/ your root partition elevator=deadline

7. Reboot

Thank you for reading, the above is the content of "how to upgrade the linux-2.6 kernel". After the study of this article, I believe you have a deeper understanding of how to upgrade the linux-2.6 kernel, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report