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

What are the common system processes in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "what are the common system processes in Linux". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the common system processes in Linux"?

Kswapd0

The system will wake up kswapd every certain time to see if memory is tight, and if not, sleep. In kswapd, there are two thresholds, pages_hige and pages_low. When the number of free memory pages is lower than pages_low, the kswapd process will scan memory and release 32 free pages at a time until the number of free page 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: the slowest mode to record metadata changes on all file systems.

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 that records only the metadata of file system changes and logs before the changes.

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 records only modified metadata and relies on the standard file system write 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 contents of 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 dirty page in memory exceeds 10%, pdflush backs up the pages back to the hard drive. This ratio is adjustable, and the default value of the vm.dirty_background_ratio entry in / etc/sysctl.conf is 10.

Kthreadd

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

It is created during kernel initialization and runs in a loop with a function called kthreadd that runs 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, and kthread_create will weak up kthreadd_task. Kthreadd invokes the old interface when executing kthread-kernel_thread runs a kernel thread named "kthread" to run the created kthread, the executed kthread is removed from the kthread_create_list linked list, and the kthreadd keeps calling scheduler to give up CPU. This thread cannot be shut down.

Migration

There are 32 such kernel threads. From migration/0 to migration/31, each processor core corresponds to a migration kernel thread. The main function is to act as the migration process of the corresponding CPU core to perform the process migration operation. The function in the kernel is migration_thread ()

A load balancing system with kernel 2.6 that automatically loads (one for each cpu) when the system starts, sets itself as a real-time process for SCHED_FIFO, then checks runqueue::migration_queue for requests waiting to be processed, and if not, hibernates in TASK_INTERRUPTIBLE until it is woken up and checked again. Migration_thread () is just an interface for functions such as CPU binding and CPU power management. This thread is an important part of the scheduling system.

Watchdog

There are 32 such kernel threads, from watchdog/0 to watchdog/31, and 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 the watchdog is started (that is, after the / dev/watchdog device is turned on), if the / dev/watchdog is not written within a set time interval (1 minute), 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, with one events kernel thread for each processor core. Used to handle kernel events many hardware and software events (such as power outages, file changes) are converted to events and distributed to threads interested in responding to the corresponding events.

Kblockd

There are 32 such kernel threads, from kblockd/0 to kblockd/31, with one kblockd kernel thread for each processor core. The block device used to manage the system, which periodically activates the block device driver within the system. If you have a block device, these threads cannot be removed.

Aio

There are 32 such kernel threads, from aio/0 to aio/31, and each processor core corresponds to an aio kernel thread, which is used to support user-mode AIO (Asynchronous Imax O) and should not be turned off.

Rpciod

There are 32 such kernel threads, from rpciod/0 to rpciod/31, and each processor core corresponds to a rpciod kernel thread, which is mainly used as a daemon for remote procedure call services to start the NFS O service from the client, which is usually used when starting the Linux service.

At this point, I believe you have a deeper understanding of "what are the common system processes in Linux?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Development

Wechat

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

12
Report