分享

[Nemeth00] Section 28.4. System daemons

 Stefen 2010-07-18

28.4. System daemons

A few system tasks, such as managing virtual memory and synchronizing the disk cache, are managed by daemons rather than by the kernel itself. The daemons that perform these functions cannot be manipulated by the system administrator and should generally be left alone.

The paging daemon

The implementation of this daemon and its exact function vary widely across systems. It is named pageout on Solaris, vhand on HP-UX, kpiod under Red Hat, and pagedaemon under FreeBSD.

This daemon is part of the virtual memory system. When a page of virtual memory is accessed, the system’s hardware consults a table to determine whether the page is currently in physical memory. If not, a fault occurs and the paging daemon is called to bring the page into memory from the swap area. If no physical pages are available, the paging daemon makes room by writing out some other page to the swap device and updating the appropriate page table entries.

See page 760 for more information about virtual memory.


The swapping daemon

This daemon is called swapper on FreeBSD and HP-UX, and kswapd on Linux.

When many processes are running simultaneously, the system begins to spend a lot of time processing page faults because each process has a certain number of pages that it accesses regularly. This condition is called thrashing, and it can seriously degrade performance.

The swapping daemon monitors the number of page faults that occur in proportion to the number of memory references. If too many faults occur, the swapping daemon starts to move entire processes out to the swap space. Swapped processes are completely removed from physical memory and are prevented from running for a comparatively long time (seconds). The swapping daemon continues to eliminate processes until the page fault rate falls to an acceptable level.

Swapping was designed for an era in which physical memory was very expensive, and the need for it in today’s computing landscape is questionable. Nevertheless, most systems still provide this capability.

The filesystem synchronization daemon

The filesystem synchronization daemon executes the sync system call every 30 seconds. sync causes all “dirty” disk blocks to be written out, including filesystem superblocks, inode tables, and buffered data blocks.[4] This housekeeping minimizes the filesystem damage that can occur during a crash.

[4] Actually, sync simply schedules these blocks to be written out; it doesn’t guarantee that writing has completed by the time it returns.

See page 133 for more information about filesystem superblocks.


On most systems this daemon is called update, but HP-UX calls it syncer and Solaris calls it fsflush.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多