Memory Management in Linux Kernel

Linux Kernel Programming - Memory Management in Deep
Instructor:
Linux Trainer
6 students enrolled
English [Auto]
Knowledge of Memory management in Linux Kernel

What will you learn from this course?

  • Physical Address space of processor and how to view it in Linux
  • Virtual Address space of processor
  • Kernel and User space virtual address space
  • Pages and Page Fault
  • How to convert virtual address into physical address and the format specifiers used to print
  • Low Memory and High Memory
  • Memory Allocation Mechanism – Buddy Allocator
  • Zones – /proc/buddyinfo
  • Dynamic Memory Allocation in Linux Kernel
  • Various flags used in kmalloc – GFP_KERNEL, GFP_ATOMIC, GFP_DMA
  • Differences between kmalloc and vmalloc
  • What happens when you pass 0 in kmalloc and vmalloc
  • Kernel Stack

API’s covered in this course:

  • virt_to_phys
  • phys_to_virt
  • kmalloc
  • kfree
  • krealloc
  • ksize
  • vmalloc
  • vfree

Commands used in this course:

  • qemu-system-x86

Memory Management Part 1

1
What is Physical Address Space
2
How to view memory map/physical address space in Linux - /proc/iomem
3
Running 32-bit Buildroot image in QEMU
4
View/Change RAM Size in QEMU - /proc/meminfo, free -m
5
Virtual Address Space for 32-bit processors
6
Why kernel shares its address space for all processes
7
64-bit Memory Map
8
Converting Virtual address to physical address and vice versa
9
Pages - PAGE_SIZE macro
10
struct page
11
Page Fault
12
Page Faults when memory is 4 KB
13
User space virtual address space
14
Kernel Virtual address space - low mem and high mem
15
Low Memory
16
How can i find out how much is my low mem and high mem
17
High Memory
18
Memory Allocation Mechanism
19
kmalloc and kfree
20
Linux Kernel Module example of kmalloc and kfree

Memory Management Part 2

1
Zones
2
Buddy System allocator
3
Virtual Kernel Memory Layout
4
Can i use virt_to_phy to get physical address of kmalloc pointer
5
Example of passing various GFP_FLAGS to kmalloc
6
Maximum size that can be allocated using kmalloc
7
What happens if we don't free memory allocated using kmalloc
8
ksize
9
kzalloc
10
krealloc
11
Example to demonstrate kmalloc is contiguous in physical and virtual
12
vmalloc
13
Maximum size that can be allocated using vmalloc
14
vmalloc vs kmalloc
15
Maximum size that can be allocated using vmalloc on 32-bit
16
Why is VmallocUsed always 0
17
Can i use ksize with vmalloc
18
Maximum amount of memory that can be allocated using vmalloc
19
What happens when i do kmalloc of 0 zero bytes
20
What happens when i do vmalloc of 0 bytes
21
Kernel Stack
22
CONFIG_FRAME_WARN
23
check_stack.pl script
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!

Be the first to add a review.

Please, login to leave a review
5b55907a61a84fbc5ecb80fabdc2f6e6
30-Day Money-Back Guarantee

Includes

2 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion