Home System Tutorial LINUX System 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
linux linux tutorial Red Hat linux system linux command linux certification red hat linux linux 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 of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Difference between centos and ubuntu Difference between centos and ubuntu Apr 14, 2025 pm 09:09 PM

The key differences between CentOS and Ubuntu are: origin (CentOS originates from Red Hat, for enterprises; Ubuntu originates from Debian, for individuals), package management (CentOS uses yum, focusing on stability; Ubuntu uses apt, for high update frequency), support cycle (CentOS provides 10 years of support, Ubuntu provides 5 years of LTS support), community support (CentOS focuses on stability, Ubuntu provides a wide range of tutorials and documents), uses (CentOS is biased towards servers, Ubuntu is suitable for servers and desktops), other differences include installation simplicity (CentOS is thin)

How to use docker desktop How to use docker desktop Apr 15, 2025 am 11:45 AM

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

How to install centos How to install centos Apr 14, 2025 pm 09:03 PM

CentOS installation steps: Download the ISO image and burn bootable media; boot and select the installation source; select the language and keyboard layout; configure the network; partition the hard disk; set the system clock; create the root user; select the software package; start the installation; restart and boot from the hard disk after the installation is completed.

Centos options after stopping maintenance Centos options after stopping maintenance Apr 14, 2025 pm 08:51 PM

CentOS has been discontinued, alternatives include: 1. Rocky Linux (best compatibility); 2. AlmaLinux (compatible with CentOS); 3. Ubuntu Server (configuration required); 4. Red Hat Enterprise Linux (commercial version, paid license); 5. Oracle Linux (compatible with CentOS and RHEL). When migrating, considerations are: compatibility, availability, support, cost, and community support.

How to view the docker process How to view the docker process Apr 15, 2025 am 11:48 AM

Docker process viewing method: 1. Docker CLI command: docker ps; 2. Systemd CLI command: systemctl status docker; 3. Docker Compose CLI command: docker-compose ps; 4. Process Explorer (Windows); 5. /proc directory (Linux).

Detailed explanation of docker principle Detailed explanation of docker principle Apr 14, 2025 pm 11:57 PM

Docker uses Linux kernel features to provide an efficient and isolated application running environment. Its working principle is as follows: 1. The mirror is used as a read-only template, which contains everything you need to run the application; 2. The Union File System (UnionFS) stacks multiple file systems, only storing the differences, saving space and speeding up; 3. The daemon manages the mirrors and containers, and the client uses them for interaction; 4. Namespaces and cgroups implement container isolation and resource limitations; 5. Multiple network modes support container interconnection. Only by understanding these core concepts can you better utilize Docker.

What to do if the docker image fails What to do if the docker image fails Apr 15, 2025 am 11:21 AM

Troubleshooting steps for failed Docker image build: Check Dockerfile syntax and dependency version. Check if the build context contains the required source code and dependencies. View the build log for error details. Use the --target option to build a hierarchical phase to identify failure points. Make sure to use the latest version of Docker engine. Build the image with --t [image-name]:debug mode to debug the problem. Check disk space and make sure it is sufficient. Disable SELinux to prevent interference with the build process. Ask community platforms for help, provide Dockerfiles and build log descriptions for more specific suggestions.

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

See all articles