Silberschatz galvin and gagne 2013 operating system

This preview shows page 32 - 37 out of 37 pages.

Silberschatz, Galvin and Gagne  © 2013 Operating System Concepts – 9 th  Edition Allocating Kernel Memory Treated differently from user memory Often allocated from a free-memory pool Kernel requests memory for structures of varying sizes Some kernel memory needs to be contiguous I.e. for device I/O
Image of page 32

Subscribe to view the full document.

9.33 Silberschatz, Galvin and Gagne  © 2013 Operating System Concepts – 9 th  Edition Buddy System Allocates memory from fixed-size segment consisting of physically- contiguous pages Memory allocated using  power-of-2 allocator Satisfies requests in units sized as power of 2 Request rounded up to next highest power of 2 When smaller allocation needed than is available, current chunk split  into two buddies of next-lower power of 2 Continue until appropriate sized chunk available For example, assume 256KB chunk available, kernel requests 21KB Split into A L   and  A R  of 128KB each One further divided into B L  and B R  of 64KB One further into C L  and C R  of 32KB each – one used to satisfy  request Advantage – quickly  coalesce  unused chunks into larger chunk Disadvantage - fragmentation
Image of page 33
9.34 Silberschatz, Galvin and Gagne  © 2013 Operating System Concepts – 9 th  Edition Buddy System Allocator
Image of page 34

Subscribe to view the full document.

9.35 Silberschatz, Galvin and Gagne  © 2013 Operating System Concepts – 9 th  Edition Slab Allocator Alternate strategy Slab   is one or more physically contiguous pages Cache   consists of one or more slabs Single cache for each unique kernel data structure Each cache filled with  objects   – instantiations of the data  structure When cache created, filled with objects marked as  free When structures stored, objects marked as  used If slab is full of used objects, next object allocated from empty  slab If no empty slabs, new slab allocated Benefits include no fragmentation, fast memory request  satisfaction
Image of page 35
9.36 Silberschatz, Galvin and Gagne  © 2013 Operating System Concepts – 9 th  Edition Slab Allocation
Image of page 36

Subscribe to view the full document.

Silberschatz, Galvin and Gagne  © 2013 Operating System Concepts – 9 th  Edition End of Chapter 9
Image of page 37
You've reached the end of this preview.
  • Winter '15
  • Virtual memory, Gagne, Galvin, Silberschatz

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern