Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lec 7aOperating Systems1 Operating Systems Lecture 7a: Linux Memory Manager William M. Mongan.

Similar presentations


Presentation on theme: "Lec 7aOperating Systems1 Operating Systems Lecture 7a: Linux Memory Manager William M. Mongan."— Presentation transcript:

1 Lec 7aOperating Systems1 Operating Systems Lecture 7a: Linux Memory Manager William M. Mongan

2 Linux Pages Linux pages are defined as a struct_page in linux/mm.h typedef struct page { struct list_head list; struct address_space *mapping; unsigned long index; struct page *next_hash; atomic_t count; unsigned long flags; struct list_head lru; unsigned char age; unsigned char zone; struct pte_chain * pte_chain; struct page **pprev_hash; struct buffer_head * buffers; #if defined(CONFIG_HIGHMEM) || defined(CONFIG_SPARC64) void *virtual; #endif /* CONFIG_HIGMEM || CONFIG_SPARC64 */ } mem_map_t;

3 Linux Pages count:reference count flags: bit field including dirty bit, etc. –See linux/page-flags.h virtual: virtual address

4 Zones ZONE_DMA –Allows hardware performing DMA to have memory addresses mapped where they need them ZONE_NORMAL ZONE_HIGHMEM –Dynamically mapped at addresses higher than what may be virtually addressed struct zone in linux/mmzone.h

5 Kernel Page Allocation linux/mm.h and mm/page_alloc.c –alloc_page (return the page structure), get_free_page (return logical address) –free_page(logical_address) Or, linux/slab.h for continuous slab –kmalloc(size, flag) and kfree(ptr) Or, linux/vmalloc.h and mm/vmalloc.c for noncontinuous physical page allocation vmalloc(size)


Download ppt "Lec 7aOperating Systems1 Operating Systems Lecture 7a: Linux Memory Manager William M. Mongan."

Similar presentations


Ads by Google