The Linux Programming Interface
Memory Mappings 1037 if (munmap(addr, sizeof(int)) == -1) errExit("munmap"); exit(EXIT_SUCCESS); } } ––––––––––––––––––––––––––– ...
1038 Chapter 49 On Linux, the realloc() function uses mremap() to efficiently reallocate large blocks of memory that malloc() pr ...
Memory Mappings 1039 Denying obvious overcommits means that new mappings whose size doesn’t exceed the amount of currently avail ...
1040 Chapter 49 killer. Other factors that increase a process’s likelihood of selection are forking to create many child process ...
Memory Mappings 1041 above, a portable application should avoid trying to create a new mapping at a fixed address. The first ste ...
1042 Chapter 49 The pgoff and size arguments identify a file region whose position in memory is to be changed. The pgoff argumen ...
Memory Mappings 1043 individual pages. It was intended that remap_file_pages() would allow permis- sions on individual pages wit ...
1044 Chapter 49 Swap space overcommitting allows the system to allocate more memory to processes than is actually available in R ...
Chapter 50: Virtual Memory Operations This chapter looks at various system calls that perform operations on a process’s virtual ...
1046 Chapter 50 The value given in addr must be a multiple of the system page size (as returned by sysconf(_SC_PAGESIZE)). (SUSv ...
Virtual Memory Operations 1047 int main(int argc, char *argv[]) { char cmd[CMD_SIZE]; char *addr; /* Create an anonymous mapping ...
1048 Chapter 50 In this section, we look at the system calls used for locking and unlocking part or all of a process’s virtual m ...
Virtual Memory Operations 1049 The reason RLIMIT_MEMLOCK has different semantics for System V shared memory is that a shared mem ...
1050 Chapter 50 Details of the semantics of memory locking In the following paragraphs, we note some details of the semantics of ...
Virtual Memory Operations 1051 The mlockall() system call locks all of the currently mapped pages in a process’s vir- tual addre ...
1052 Chapter 50 The mincore() system call returns memory-residence information about pages in the virtual address range starting ...
Virtual Memory Operations 1053 if (mincore(addr, length, vec) == -1) errExit("mincore"); for (j = 0; j < numPages; j++) { if ...
1054 Chapter 50 The following shell session shows a sample run of the program in Listing 50-2. In this example, we allocate 32 p ...
Virtual Memory Operations 1055 MADV_SEQUENTIAL Pages in this range will be accessed once, sequentially. Thus, the kernel can agg ...
1056 Chapter 50 50.5 Summary In this chapter, we considered various operations that can be performed on a pro- cess’s virtual me ...
«
50
51
52
53
54
55
56
57
58
59
»
Free download pdf