|
ginnOS
The reference: libc, the libraries and the kernel
|
TLB shootdown: a change to the page tables reaches the TLB of every core that can hold the old entry. More...
Go to the source code of this file.
Functions | |
| void | tlb_init (void) |
| set up the shootdown. | |
| void | tlb_shootdown_user (struct user_space *space, uintptr_t start, uintptr_t end) |
| flush [start, end) of a user space on the other cores that have it loaded, and wait until they have flushed. | |
| void | tlb_shootdown_kernel (uintptr_t start, uintptr_t end) |
| flush [start, end) of the kernel half on all the other cores, and wait until they have flushed. | |
| void | tlb_do_pending (void) |
| do the flush that another core asks of this core, if there is one. | |
TLB shootdown: a change to the page tables reaches the TLB of every core that can hold the old entry.
the paging functions flush the TLB of the core that makes the change. the other cores can still hold the old entry: those that have the user space loaded (its cpu_mask), or every core for the kernel half. the caller of a shootdown sends those cores an IPI and waits until each has flushed. only then may it free the frames that the old entries pointed to. one request is out at a time, as in Linux's old i386 flush_tlb_others.
a core that spins on a spinlock with interrupts off does a pending flush while it waits (tlb_poll), so a caller that holds a lock while it waits for the other cores cannot deadlock with a core that waits for that lock.
| void tlb_init | ( | void | ) |
set up the shootdown.
call once on the boot core, before the other cores start.
| void tlb_shootdown_user | ( | struct user_space * | space, |
| uintptr_t | start, | ||
| uintptr_t | end ) |
flush [start, end) of a user space on the other cores that have it loaded, and wait until they have flushed.
call it after the change to the page tables and before the frames are freed. any context; interrupts can be on or off.
| space | the user space whose page tables changed. |
| start | the first address, page-aligned. |
| end | the address after the range. |
flush [start, end) of the kernel half on all the other cores, and wait until they have flushed.
| start | the first address, page-aligned. |
| end | the address after the range. |
| void tlb_do_pending | ( | void | ) |
do the flush that another core asks of this core, if there is one.
the IPI handler calls it. call it with interrupts off.