Linux Kernel Memory Management: differences between segments and pages

Source: Internet
Author: User

Segmentation and paging are two ways to divide or map addresses.

The differences between the two are as follows:

A) The page is the physical unit of information, and the page is the discrete distribution method,To reduce the external zero header of the memory and improve the memory utilization; or,Pagination is only required by the system management, not by the user's needs (it is also transparent to the user ). A segment is the logical unit of information. It contains a set of relatively complete information (such as data segments, code segments, and stack segments ).The purpose of segmentation is to better meet user needs (users can also use it ).

B) The page size is fixed and determined by the system,The logic address is divided into two parts: the page number and the page address, which are implemented by the hardware of the machine,Therefore, a system can only have one page size. The length of the segment is not fixed, which is determined by the program you write,It is usually divided by the editing program based on the nature of the information when editing the source program.

C) The paging job address space is one dimension, that is, a single linear space,A programmer can express an address only by using a memory character (in hexadecimal notation of a linear address. The address space of a segmented job is two-dimensional. When a programmer identifies an address,Both the segment name (such as the Data Segment, code segment, and stack segment) and the intra-segment address are required.

D. Both pages and segments have a storage protection mechanism. However, the access permission is different: the segment has three permissions: read, write, and execution, while the page has only two permissions: read and write.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.