The Multics virtual memory: concepts and design Bensoussan, Clingen 1972 Summary by Ed Swierk Thesis: Sharing of data among users on a system is important for many applications. Main ideas ---------- direct addressing + access controls => sharing The Multics VM system allows all online data in the system (online meaning in main memory and on disk) to be addressed directly by the processor, without the need for special input/output routines. It also enforces access controls on every reference to this data. A segment is a chunk of information of arbitrary length that is directly addressed and on which access is controlled. A segment has attributes like name, length and access rights. Segments are split into fixed-length pages, which are loaded into main memory on demand. Implementation -------------- The underlying hardware must support segmentation; without it, data in main memory is just an anonymous block of data, on which the processor cannot enforce access controls or address by name. data reference: (name, i) where name is the symbolic segment name and i is the word number in the segment access rights: read, write, execute, append Honeywell 645 processor: - segmenting: addresses are [s, i] where s is the segment number and i is the index within the segment; s and i are 18 bits each - paging: each segment (including the descriptor segment!) is split into 1024-word pages, so both s and i are split into page number/word number pairs Addresses on the 645 are dereferenced in this way: - descriptor base register (DBR) points to descriptor segment (DS) - DS is a table (itself spanning several pages) of segment descriptor words (SDW) - SDW contains core address of the segment's page table (PT) - PT is a table of page table words (PTW) - PTW contains core address of the page itself The supervisor (kernel) is segmented just like user programs. Analysis -------- Assumptions: - sharing is important - applications can somehow divide the data they manage into logical segments, and assign access rights to them - main memory is small relative to secondary memory Is sharing really as important as the authors assert? Most sharing is between user processes and the kernel, not among different user processes. Other OSes have specialized mechanisms for this kind of sharing, but not the general kind that Multics supports. Advantages/disadvantages of segmentation: + makes sharing data easier ? doesn't really make a difference for programs that never access data/code in other processes Advantages/disadvantages of paging: + entire segment need not be in main memory at once, so segments can be of arbitrary size + automatically takes advantage of locality of reference + lets programmers write in a less machine-dependent manner, so a program will run regardless of main memory size, though not necessarily efficiently + eliminates need for memory compaction (assuming fixed-length pages) - complicated - slower, since all references need to go through page table How does the segmented architecture compare with other mechanisms for sharing data across processes (e.g. explicit shared memory, pipes, etc.)? Current systems like Unix could be thought of as having segmented architecture where the entire address space of a process is in one segment, and access is allowed only by the process itself and by the kernel. Could this segmented architecture be extended to share data across machines (e.g. distributed shared memory, or distributed file system?)