Tuesday, May 26, 2009

Memory Area Management

memory area is a sequence of contiguous physical addresses. this idea came up from the event that the kerne uses the same kind of objects. so grouping them will save much mem space.

qus: what happens when cache is increased or decreased? it is not supposed to get contig pages anymore. it will get another group of contig pages.

there are 13 list of memory areas of sizes from 32 to 131072 bytes. each list has 2 caches: dma and normal.

user processes do not have access to or use the slab allocator. it is solely used by the kernel.

2 types: general (used by the slab alloc) and specific (used by the kernel)

kmem_cache keeps track of the other caches.

pages belong to a slab will have the PG_Slab flag set on them. it is not possible to get pages from ZONE_HIGHMEM because page_address() will return NULL in that case :D.

every physical or abstract entity has a descriptor in the kernel. a page frame within a slab has its PG_Slab flags set, lru.next=slab desc, lru.prev=cache desc. lru is used in buddy allocator to make a chain of free consecutive pages. as the page is no longer in buddy alloc, we can use this lru field to do something useful. slab pages are pseudo-free as they are free but not tracked by the buddy alloc.

slab page frames can be tracked by s_mem of slab desc and cachedesc.gfporder

No comments:

Post a Comment