Changeset 1b20da0 in mainline for kernel/generic/src/mm
- Timestamp:
- 2018-02-28T17:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- Location:
- kernel/generic/src/mm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
rdf6ded8 r1b20da0 344 344 * page. 345 345 */ 346 int const gp = (guarded || 346 int const gp = (guarded || 347 347 (area->flags & AS_AREA_GUARD)) ? 1 : 0; 348 348 -
kernel/generic/src/mm/backend_elf.c
rdf6ded8 r1b20da0 349 349 350 350 frame = PTE_GET_FRAME(&pte); 351 } 351 } 352 352 } else if (upage >= start_anon) { 353 353 /* … … 385 385 PAGE_SIZE - pad_lo - pad_hi); 386 386 if (entry->p_flags & PF_X) { 387 smc_coherence_block((void *) (kpage + pad_lo), 387 smc_coherence_block((void *) (kpage + pad_lo), 388 388 PAGE_SIZE - pad_lo - pad_hi); 389 389 } -
kernel/generic/src/mm/backend_phys.c
rdf6ded8 r1b20da0 61 61 typedef struct { 62 62 uintptr_t base; 63 size_t frames; 63 size_t frames; 64 64 } phys_shared_data_t; 65 65 -
kernel/generic/src/mm/frame.c
rdf6ded8 r1b20da0 288 288 NO_TRACE static size_t find_free_zone_lowprio(size_t count, zone_flags_t flags, 289 289 pfn_t constraint, size_t hint) 290 { 290 { 291 291 for (size_t pos = 0; pos < zones.count; pos++) { 292 292 size_t i = (pos + hint) % zones.count; -
kernel/generic/src/mm/km.c
rdf6ded8 r1b20da0 53 53 static ra_arena_t *km_ni_arena; 54 54 55 #define DEFERRED_PAGES_MAX (PAGE_SIZE / sizeof(uintptr_t)) 55 #define DEFERRED_PAGES_MAX (PAGE_SIZE / sizeof(uintptr_t)) 56 56 57 57 /** Number of freed pages in the deferred buffer. */ … … 188 188 { 189 189 uintptr_t page; 190 size_t offs; 191 192 offs = paddr - ALIGN_DOWN(paddr, FRAME_SIZE); 190 size_t offs; 191 192 offs = paddr - ALIGN_DOWN(paddr, FRAME_SIZE); 193 193 page = km_map_aligned(ALIGN_DOWN(paddr, FRAME_SIZE), 194 194 ALIGN_UP(size + offs, FRAME_SIZE), flags); … … 205 205 void km_unmap(uintptr_t vaddr, size_t size) 206 206 { 207 size_t offs; 208 209 offs = vaddr - ALIGN_DOWN(vaddr, PAGE_SIZE); 207 size_t offs; 208 209 offs = vaddr - ALIGN_DOWN(vaddr, PAGE_SIZE); 210 210 km_unmap_aligned(ALIGN_DOWN(vaddr, PAGE_SIZE), 211 211 ALIGN_UP(size + offs, PAGE_SIZE)); … … 258 258 page = km_map(frame, PAGE_SIZE, 259 259 PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE); 260 if (!page) { 260 if (!page) { 261 261 frame_free(frame, 1); 262 262 goto lowmem; -
kernel/generic/src/mm/page.c
rdf6ded8 r1b20da0 178 178 179 179 /** Make the mapping shared by all page tables (not address spaces). 180 * 180 * 181 181 * @param base Starting virtual address of the range that is made global. 182 182 * @param size Size of the address range that is made global. -
kernel/generic/src/mm/slab.c
rdf6ded8 r1b20da0 39 39 * 40 40 * with the following exceptions: 41 * @li empty slabs are deallocated immediately 41 * @li empty slabs are deallocated immediately 42 42 * (in Linux they are kept in linked list, in Solaris ???) 43 43 * @li empty magazines are deallocated when not needed … … 52 52 * good SMP scaling. 53 53 * 54 * When a new object is being allocated, it is first checked, if it is 54 * When a new object is being allocated, it is first checked, if it is 55 55 * available in a CPU-bound magazine. If it is not found there, it is 56 56 * allocated from a CPU-shared slab - if a partially full one is found, 57 * it is used, otherwise a new one is allocated. 57 * it is used, otherwise a new one is allocated. 58 58 * 59 59 * When an object is being deallocated, it is put to a CPU-bound magazine. 60 * If there is no such magazine, a new one is allocated (if this fails, 60 * If there is no such magazine, a new one is allocated (if this fails, 61 61 * the object is deallocated into slab). If the magazine is full, it is 62 62 * put into cpu-shared list of magazines and a new one is allocated. … … 79 79 * the frame allocator fails to allocate a frame, it calls slab_reclaim(). 80 80 * It tries 'light reclaim' first, then brutal reclaim. The light reclaim 81 * releases slabs from cpu-shared magazine-list, until at least 1 slab 81 * releases slabs from cpu-shared magazine-list, until at least 1 slab 82 82 * is deallocated in each cache (this algorithm should probably change). 83 83 * The brutal reclaim removes all cached objects, even from CPU-bound … … 90 90 * to add cpu-cached magazine cache (which would allocate it's magazines 91 91 * from non-cpu-cached mag. cache). This would provide a nice per-cpu 92 * buffer. The other possibility is to use the per-cache 92 * buffer. The other possibility is to use the per-cache 93 93 * 'empty-magazine-list', which decreases competing for 1 per-system 94 94 * magazine cache. … … 660 660 } 661 661 662 /** Create slab cache 662 /** Create slab cache 663 663 * 664 664 */
Note:
See TracChangeset
for help on using the changeset viewer.