8-2-Partner system-Dynamic Storage Management-8th chapter-Data structure textbook source code-Min 聯繫 version

Source: Internet
Author: User

Textbook Source Code section

Chapter 8th Partner Systems- boundary labeling Method

--"Data structure"-Min. 聯繫 version

Source code Use instructions link??? data Structure-C language edition (Min, 聯繫 version) textbook source + problem sets analysis using instructions

Textbook source Collection link??? "Data structure" textbook source code compilation

Problem sets full parse link??? analysis of the problem of the data structure problems in the compilation

Source code introduced by the file link? Status.h

relevant test data download link? Data Package

document source code and test data storage directory: Data structure \▲ textbook algorithm implementation \▲08 dynamic storage Management \02 Buddysystem

Overview

One of the most important things about Linux kernel memory management is how to avoid fragmentation when you frequently request to release memory. Linux uses a partner system to solve the problem of external fragmentation, using slab to solve internal fragmentation issues, where we discuss external fragmentation issues.

parsing

There are two ways to avoid external fragmentation: one is to use the allocation of non-contiguous memory, and the other is to use an efficient method to monitor the memory, ensuring that the kernel will not intercept a chunk of contiguous free memory when it requests a small chunk of memory, thus guaranteeing the continuity and integrity of the chunk memory. Obviously, the former can not be a common way to solve the problem, one to map the non-contiguous memory linear address space is limited, and each mapping to rewrite the kernel's page table, and then flush the TLB, which makes the allocation of the speed is greatly reduced, this is very often to apply for the memory of the kernel is obviously unbearable. So Linux uses the latter to solve the problem of external fragmentation, known as the partner system.

The purpose of the partner system is to satisfy the kernel's request for memory with the smallest memory block.

Source Code file one? BuddySystem.h

file two? buddysystem.c

file three? buddysystem-main.c (test document)

test results show

more chapters in the Continuous update ...

8-2-Partner system-Dynamic Storage Management-8th chapter-Data structure textbook source code-Min 聯繫 version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.