search
HomeSystem TutorialLINUXSystem process: 10 knowledge points that operation and maintenance personnel must be familiar with

System process: 10 knowledge points that operation and maintenance personnel must be familiar with

Jan 05, 2024 pm 05:24 PM
linuxlinux tutorialRed Hatlinux systemlinux commandlinux certificationred hat linuxlinux video

Introduction In daily operation and maintenance work, when we habitually execute the ps command, we will see many "weird" processes, and most of these processes are the kernel processes of the system. Many students know very little about it, so today I will compile an entry-level system process introduction post for you, hoping to help everyone understand the operating system process.

In daily operation and maintenance work, when we habitually execute the ps command, we will see many "weird" processes, and most of these processes are the kernel processes of the system. Many students know very little about it, so today I will compile an entry-level system process introduction post for you, hoping to help everyone understand the operating system process.
System process: 10 knowledge points that operation and maintenance personnel must be familiar with

Preface

In daily operation and maintenance work, we often see some strange system processes that occupy relatively high resources. And I always hear students from the business line asking, "What process is xxx? Why have so many of them been opened?"

These system-level kernel processes are enclosed in square brackets, and they perform some system auxiliary functions (such as writing cache to disk); processes without brackets are processes executed by users (such as php, nginx, etc.).

As shown below:
System process: 10 knowledge points that operation and maintenance personnel must be familiar with
Here are 10 common system processes for everyone:
kswapd0
kjournald
pdflush
kthreadd
migration
watchdog
events
kblockd
aio
rpciod

kswapd0

The system will wake up kswapd every certain period of time to see if the memory is tight. If not, it will go to sleep. In kswapd, there are two thresholds, pages_hige and pages_low. When the number of free memory pages is lower than pages_low time, the kswapd process will scan the memory and release 32 free pages each time until the number of free pages reaches pages_high.

Linux uses kswapd for virtual memory management such that pages that have been recently accessed are kept in memory and less active pages are paged out to disk.(what is a page?)…Linux uses manages memory in units called pages.So ,the kswapd process regularly decreases the ages of unreferenced pages…and at the end they are paged out(moved out) to disk

kjournald

journal: Record metadata changes on all file systems, the slowest mode.

logs all filesystem data and metadata changes. The slowest of the three ext3 journaling modes, this journaling mode minimizes the chance of losing the changes you have made to any file in an ext3 filesystem.

ordered: The default mode, only records the metadata of file system changes, and records the log before the change.

only logs changes to filesystem metadata, but flushes file data updates to disk before making changes to associated filesystem metadata. This is the default ext3 journaling mode.

writeback: The fastest mode, which also only records modified metadata and relies on the standard file system writing process to write data to the hard disk

only logs changes to filesystem metadata but relies on the standard filesystem write process to write file data changes to disk. This is the fastest ext3 journaling mode.

pdflush

pdflush is used to synchronize the content in memory with the file system.

For example: when a file is modified in memory, pdflush is responsible for writing it back to the hard disk. Whenever the number of dirty pages in memory exceeds 10%, pdflush will back up these pages back to the hard disk. This ratio is adjustable, and the default value is 10 through the vm.dirty_background_ratio item in /etc/sysctl.conf.

kthreadd

There is only one such kernel thread, and its role is to manage and schedule other kernel threads.

It is created when the kernel is initialized and will run a function called kthreadd in a loop. The function of this function is to run the kthread maintained in the kthread_create_list global linked list. You can call kthread_create to create a kthread, which will be added to the kthread_create_list linked list. At the same time, kthread_create will weak up kthreadd_task. When kthreadd executes kthread, it will call the old interface - kernel_thread runs a kernel thread named "kthread" to run the created kthread. The executed kthread will be deleted from the kthread_create_list list, and kthreadd will continuously call scheduler to give up the CPU. This thread cannot be closed.

migration

There are 32 kernel threads of this kind, from migration/0 to migration/31. Each processor core corresponds to a migration kernel thread. Its main function is to serve as the migration process of the corresponding CPU core and is used to perform process migration operations. The kernel The function in is migration_thread()

Belongs to the load balancing system of the 2.6 kernel. This process is automatically loaded when the system starts (one for each CPU), and sets itself as a real-time process of SCHED_FIFO, and then checks whether there are requests waiting to be processed in runqueue::migration_queue. If If not, it will sleep in TASK_INTERRUPTIBLE until it is woken up and checked again. migration_thread() is just an interface for CPU binding and CPU power management functions. This thread is an important part of the scheduling system.

watchdog

There are 32 kernel threads in total, from watchdog/0 to watchdog/31. Each processor core corresponds to a watchdog kernel thread. Watchdog is used to monitor the operation of the system and automatically restart the system when the system fails, including A kernel watchdog module and a user-space watchdog program.

Under the Linux kernel, the basic working principle of watchdog is: when watchdog is started (that is, after the /dev/watchdog device is opened), if /dev/watchdog does not exist within a certain set time interval (1 minute) When a write operation is performed, the hardware watchdog circuit or software timer will restart the system, and each write operation will cause the timer to be reset.

events

There are 32 such kernel threads, from events/0 to events/31, and each processor core corresponds to an events kernel thread. Used to process kernel events. Many software and hardware events (such as power outages, file changes) are converted into events and distributed to threads interested in corresponding events for response.

kblockd

There are 32 such kernel threads, from kblockd/0 to kblockd/31, and each processor core corresponds to a kblockd kernel thread. Used to manage system block devices, it periodically activates block device drivers in the system. If you own a block device, these threads cannot be removed.

aio

There are 32 such kernel threads, from aio/0 to aio/31. Each processor core corresponds to an aio kernel thread, which manages I/O instead of the user process to support user-mode AIO (asynchronous I/O). O), should not be closed.

rpciod

There are 32 kernel threads of this kind, from rpciod/0 to rpciod/31. Each processor core corresponds to one rpciod kernel thread. Its main function is to serve as a daemon for remote procedure call services and is used to start I from the client. /O service, usually used when starting the NFS service.

Summarize

Process is a very important concept in the operating system. All data running on the system will exist in the type of process. In the Linux system: when any event is triggered, the system will define it as a process. Therefore, the process is the only way to implement a Linux program.

The above is the detailed content of System process: 10 knowledge points that operation and maintenance personnel must be familiar with. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Linux就该这么学. If there is any infringement, please contact admin@php.cn delete
How does hardware compatibility differ between Linux and Windows?How does hardware compatibility differ between Linux and Windows?Apr 23, 2025 am 12:15 AM

Linux and Windows differ in hardware compatibility: Windows has extensive driver support, and Linux depends on the community and vendors. To solve Linux compatibility problems, you can manually compile drivers, such as cloning RTL8188EU driver repository, compiling and installing; Windows users need to manage drivers to optimize performance.

What are the differences in virtualization support between Linux and Windows?What are the differences in virtualization support between Linux and Windows?Apr 22, 2025 pm 06:09 PM

The main differences between Linux and Windows in virtualization support are: 1) Linux provides KVM and Xen, with outstanding performance and flexibility, suitable for high customization environments; 2) Windows supports virtualization through Hyper-V, with a friendly interface, and is closely integrated with the Microsoft ecosystem, suitable for enterprises that rely on Microsoft software.

What are the main tasks of a Linux system administrator?What are the main tasks of a Linux system administrator?Apr 19, 2025 am 12:23 AM

The main tasks of Linux system administrators include system monitoring and performance tuning, user management, software package management, security management and backup, troubleshooting and resolution, performance optimization and best practices. 1. Use top, htop and other tools to monitor system performance and tune it. 2. Manage user accounts and permissions through useradd commands and other commands. 3. Use apt and yum to manage software packages to ensure system updates and security. 4. Configure a firewall, monitor logs, and perform data backup to ensure system security. 5. Troubleshoot and resolve through log analysis and tool use. 6. Optimize kernel parameters and application configuration, and follow best practices to improve system performance and stability.

Is it hard to learn Linux?Is it hard to learn Linux?Apr 18, 2025 am 12:23 AM

Learning Linux is not difficult. 1.Linux is an open source operating system based on Unix and is widely used in servers, embedded systems and personal computers. 2. Understanding file system and permission management is the key. The file system is hierarchical, and permissions include reading, writing and execution. 3. Package management systems such as apt and dnf make software management convenient. 4. Process management is implemented through ps and top commands. 5. Start learning from basic commands such as mkdir, cd, touch and nano, and then try advanced usage such as shell scripts and text processing. 6. Common errors such as permission problems can be solved through sudo and chmod. 7. Performance optimization suggestions include using htop to monitor resources, cleaning unnecessary files, and using sy

What is the salary of Linux administrator?What is the salary of Linux administrator?Apr 17, 2025 am 12:24 AM

The average annual salary of Linux administrators is $75,000 to $95,000 in the United States and €40,000 to €60,000 in Europe. To increase salary, you can: 1. Continuously learn new technologies, such as cloud computing and container technology; 2. Accumulate project experience and establish Portfolio; 3. Establish a professional network and expand your network.

What is the main purpose of Linux?What is the main purpose of Linux?Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

Does the internet run on Linux?Does the internet run on Linux?Apr 14, 2025 am 12:03 AM

The Internet does not rely on a single operating system, but Linux plays an important role in it. Linux is widely used in servers and network devices and is popular for its stability, security and scalability.

What are Linux operations?What are Linux operations?Apr 13, 2025 am 12:20 AM

The core of the Linux operating system is its command line interface, which can perform various operations through the command line. 1. File and directory operations use ls, cd, mkdir, rm and other commands to manage files and directories. 2. User and permission management ensures system security and resource allocation through useradd, passwd, chmod and other commands. 3. Process management uses ps, kill and other commands to monitor and control system processes. 4. Network operations include ping, ifconfig, ssh and other commands to configure and manage network connections. 5. System monitoring and maintenance use commands such as top, df, du to understand the system's operating status and resource usage.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.