• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Multicore synchronization in chcore
2
3## Lock List
4
5**Locks should be required from higher level to lower level.**
6
7```
8                                      big_kernel_lock (0x1000)
9              /
10sched_lock (not used) (0x100)
11              |
12    ready_queue_lock (0x10)
13```
14
15
16
17| Lock             | Description         | Level  | File                 |
18| ---------------- | ------------------- | ------ | -------------------- |
19| big_kernel_lock  | Big Kernel Lock     | 0x1000 | main.c               |
20
21sched:
22| ready_queue_lock | Protect Ready Queue | 0x10   | kernel/sched/sched.c |
23|                  |                     |        |                      |
24
25mm:
26| buddy_lock       | Protect physical page allocation | 0x10  | kernel/mm/buddy.c     |
27| slabs_lock(s)    | Protect each slab allocator      | 0x20  | kernel/mm/slab.c      |
28| vmspace_lock(s)  | Protect each vmspace mapping     | 0x100 | kernel/mm/vmregion.c  |
29| pgtbl_lock(s)    | Protect each page table          | 0x100 | kernel/mm/vmregion.c  |
30							| kernel/mm/pgfault_handler.c |
31| heap_lock        | Protect the heap of each process (cap_group) |
32