OK6410A Development Board (VIII) 38 linux-5.11 OK6410A Why do we need so many memory managers?

Publisher:真诚友爱Latest update time:2022-09-07 Source: csdnKeywords:OK6410A Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Can't I just use memblock in the end?

Is it not possible to skip memblock and directly set buddy?

The difference between memblock and buddy


Why is buddy the basis of memory manager and other managers?


Why do we need to create slab and vmalloc after creating buddy?


What are the characteristics of these memory managers???


The third stage consumer

The third stage is to establish a buddy


Alloc_pages requests are continuous pages of physical memory.

Physical addresses are continuous, virtual addresses must be continuous


But at least one page or more


question:

1. The minimum memory size that can be requested by the buddy API is one page, and it cannot be smaller

2.alloc_pages If you apply for 2 or more pages, it will return correctly only when there are 2 consecutive pages in physical memory; otherwise, it returns 0


The fourth stage consumer


Used to solve buddy's first problem

solution:

Think of buddy as a big memory wholesale agent (buddy memory allocator) and build a small agent (slab memory allocator)


slba buys memory from buddy, divides the memory into smaller blocks (A) (less than 1 page), and manages them.


Users wholesale A from slab


other:

Because the second problem is not solved, as long as the application is successful (no matter how big it is), it will definitely be the following status:

Physical addresses are continuous, virtual addresses are continuous


The fifth stage consumer


Used to solve buddy's second problem

solution:

Instead of building a distributor based on buddy

Instead, it encapsulates a layer


This extra layer mainly uses the page table to map discontinuous physical memory into the virtual kernel address space to make it appear continuous.


Keywords:OK6410A Reference address:OK6410A Development Board (VIII) 38 linux-5.11 OK6410A Why do we need so many memory managers?

Previous article:OK6410A Development Board (VIII) 39 linux-5.11 OK6410A memblock alloc and free
Next article:OK6410A Development Board (VIII) 37 linux-5.11 OK6410A Memory Management Phase 5

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号