Computer Science 822 Quiz 6 Name_______________________ 1. Linux uses segmentation in a very limited way. Which of the following attributes are DIFFERENT for KERNEL_DS and USER_DS ___ a. Segment base address ___ b. Segment size _x_ c. Segment DPL (the user DPL is 3 while the kernel is 0) 2. Where are Kernel and User spaces mapped within the 32 bit VIRTUAL address space. User virtual addresses: 0x00000000 - 0xbfffffff Kernel virtual addresses: 0xc0000000 - 0xffffffff 3. How many entries are there in an Intel Page Directory structure when page size 4K is in use: a. 256 b. 1024 b c. 2^16 d. 2^20 4. Real memory in a linux system is subdivided into 3 "zones". What are the names of the zones and where are the boundaries between them. a. (ISA) DMA 0 - 16 MB b. Normal 16 MB - 896 MB c. High 896 MB - 1 MB 5. One of the primary advantages of the use of paged virtual memory is that it is possible to allocate memory that is virtually contiguous using pages that are NOT contiguous. Identify the principal need for blocks of physically contiguous real memory. DMA transfers require contiguous buffers 6. Suppose the buddy system is used to manage a block if 16 pages numbered 0, 1, 2, .. ,15. Suppose pages 2, 3, 12, and 13 are allocated and the others free. Which page structs would comprise each free list in a linux type buddy system order 0 order 1 0, 14 order 2 4, 8 order 3 7. In the Linux buddy system a bit map is associated with each free order. Suppose an area of 32 MBytes is being managed and a page size of 4K bytes is in use. How many bits are required in the order 2 bit map. 2^25 / 2^12 = 2 ^ 13 pages 2^13 / 2 ^ (order + 1) = 2 ^ 10 = 1024 bits 8. A 1 bit in the buddy system bit map indicates that a. both buddies are free b. both buddies are allocated C c. one buddy is free and the d. the buddy at the lower address is other buddy is allocated. free and the buddy at the higher address is allocated. Consider the following code segment: mask = (realsize / zone_balance_ratio[j]); if (mask < zone_balance_min[j]) mask = zone_balance_min[j]; else if (mask > zone_balance_max[j]) mask = zone_balance_max[j]; zone->pages_min = mask; zone->pages_low = mask*2; zone->pages_high = mask*3; 9. What is the purpose of the code?? Establish the watermarks that will drive the page stealing algorithm. 10. The code is executed: a. only at boot time b. whenever real memory is allocated a c. whenever real memory is low d. both a. and c. 11. What is the purpose of the "zonelist" that is passed to __alloc_pages() Provide a list sorted in order of preference of zones that are suitable for use in satisfying the request. The slab allocator uses cache and slab structures to manage allocation of memory to kernel users. 12. The cache structure contains pointers to 3 different lists of slabs. How is it determined on which list a given slab resides? Whether the slab has no free objects, some but not all free objects, or if all the objects in the slab are free. 13. Suppose slabp->free = 4 and object 7 is freed. At the end of the free operation a. What will slab->free = 7 b. Where will the value 4 reside ? At index 7 in the free object table that follows the slab descriptor.