linux memory management - partner allocator
There are three memory allocators in linux: boot memory allocator, partner allocator and slab allocator
Partner distributor
After the initialization of the system kernel, the page allocator is used to manage the physical pages. When the page allocator is a partner allocator, the partner allocator is characterized by simple and efficient algor ...
Posted by miligraf on Thu, 03 Feb 2022 04:00:06 +0100
Song Baohua: why do Linux have to copy_from_user
Many people on the Internet ask why copy is necessary_ from_ User, someone answered. For example, baidu:
I think this question needs to be answered from two levels
The first level is why you want to copy, can you not copy?
The second level is why copy is used_ from_ User instead of memcpy directly
Why copy
Copying is necessary. It doesn' ...
Posted by brmcdani on Tue, 25 Jan 2022 03:15:36 +0100
Linux memory management zone_sizes_init
1. Introduction
stay (4) Spare memory model of Linux memory model In, we analyze bootmem_ The upper part of the init function. This time, let's go to the lower part. The lower part mainly focuses on the zone_sizes_init function expansion. Prospect review:bootmem_ The init() function code is as follows:
void __init bootmem_init(void)
{
unsign ...
Posted by mapostel on Tue, 11 Jan 2022 12:08:30 +0100
Simple analysis of C + + intelligent pointer
The meaning of smart pointer
In C + +, new and delete are the keywords to apply for and destroy heap memory. After applying for heap memory, programmers often forget to delete to release heap memory, which is easy to cause a phenomenon - memory leakage, that is, a piece of heap memory is not released after being applied, so that other programs ...
Posted by shmeeg on Sun, 02 Jan 2022 15:38:44 +0100
Linux memory management - zoned page frame allocator - 3
background
Read the fucking source code! -- By Lu XunA picture is worth a thousand words. -- By Golgi
explain:
Kernel version: 4.14ARM64 processor, Contex-A53, dual coreTools used: Source Insight 3.5, Visio
1. General
This article will analyze watermark. Simply put, when allocating pages using the zoned page frame allocator, the available fr ...
Posted by elacdude on Fri, 31 Dec 2021 07:41:39 +0100
SLUB allocator 4 for Linux memory management [slub page size calculation method]
SLUB allocator 4 for Linux memory management [slub page size calculation method]
Today, I tracked the calculation methods of object and page order in SLUB in detail and sorted them out to avoid forgetting later, mainly including:
The calculation method of page order is to apply for kmem_ How many pages should each slab apply for when caching? ...
Posted by adamdyer on Wed, 29 Dec 2021 16:56:23 +0100
[C language] dynamic memory distribution
preface
This blog post is only for me to summarize and learn the knowledge of dynamic memory allocation in C language. In the summary process, I refer to many blogs.
Reference blog:
https://www.cnblogs.com/ericling/p/11746972.html
https://blog.csdn.net/MarcoAsensio/article/details/85937002
summary
An array is a collection of a fixed n ...
Posted by CaptainChainsaw on Wed, 29 Dec 2021 04:13:47 +0100
Introduction to C language memory management
What is memory
Macroscopically, the memory that stores data can be called memory. The memory discussed in this chapter is the memory for the program in program design.
Memory is used to store data, which can be understood as arranged in boxes. Boxes are used to store data, but the boxes themselves have numbers and are continuous. This num ...
Posted by r3drain on Sun, 26 Dec 2021 19:52:19 +0100
linux memory management-page swapping
In the process of mapping a linear address to a physical address by i386 CPU, if the mapping of the address has been established, but the P(present) flag in the corresponding page table or directory item is found to be zero, then the corresponding physical page is not in memory and thus the memory access cannot be completed. In theory, this sit ...
Posted by Heywood on Mon, 18 Oct 2021 19:11:13 +0200