1 / 5

Operating Systems Lecture 7a: Linux Memory Manager

Operating Systems Lecture 7a: Linux Memory Manager. William M. Mongan. 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;

Télécharger la présentation

Operating Systems Lecture 7a: Linux Memory Manager

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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.hand mm/vmalloc.c for noncontinuous physical page allocation vmalloc(size)

More Related