| /xnu-11215/doc/vm/ |
| H A D | freezer.md | 13 …nerally speaking, we want the freezer to run when the device is under some memory pressure but bef… 21 …we have finished creating this contiguous compressor VA range, we put those segments on the swapou… 38 …we can get rid of these limits. However, when we tried to remove them we discovered they were mask… 43 …tly, we freeze processes in the idle band in LRU order (apps that have been idle the longest get f… 48 …reeze the leader process first (we skip coalition members that are not the leader). Once we freeze… 68 …we may re-freeze it. The exact heuristics for re-freeze are determined by the freezer thread. See … 80 …we have a limited number of slots in the freezer (and a swap file limit), so we don't have to keep… 89 …et_budget` in `bsd/vm/vm_compressor_backing_file.c` for details. Note that we call this every day,… 108 …rocesses\_max | The max. number of processes that can be frozen. Note that we can go a bit above t… 114 | kern.memorystatus\_freezer\_use\_ordered\_list | Should we use the ordered app list? See [app sel… [all …]
|
| H A D | memorystatus_kills.md | 35 When the system hits the vnode limit, and the VFS subsystem is not able to recycle any vnodes, we k… 43 …e jetsam. If we determine that the idle band contains exclusively false idle daemons, and there ar… 45 …se the daemons re-launch very quickly we can get stuck in jetsam loops where the daemons are re-la… 59 …ecifically the phantom cache has detected pressure (based on the rate that we're paging out and re… 72 Since frozen processes can be in any band <= foreground, we scan the bands for procs with the `P_ME… 88 The compressor has detected that we've exceeded a specific number of compressions and decompression… 100 …rrently M1 or later iPads) and we're unable to allocate more swap files (either because we've run … 101 …alitions) in ascending jetsam priority order. If we're approaching but not yet at the swapfile lim… 106 …pause for 500 m.s. between each kill. If we kill the entire idle band twice and the pressure is no… 118 Once we have no more high watermark kills, check if we should do aggressive jetsam. If not, we do `… [all …]
|
| H A D | memorystatus.md | 8 The xnu memorystatus subsystem is responsible for recovering the system when we're running dangerou… 62 1. Log this state to the os log (or serial if we're early in boot) 64 …we sometimes do pre-emptive actions on a healthy system if we're somewhat low on a specific resour… 76 …otected by the `proc_list_mlock` (Yes this is bad for scalability. Ideally we'd use finer grain lo… 119 Since we purge purgeable memory and trim the secluded pool quickly under memory pressure, this can … 147 It's woken up via a call to `memorystatus_thread_wake` whenever any subsystem determines we're runn… 149 …_memorystatus_2`, and `VM_memorystatus_3`. But we currently only use `VM_memorystatus_1`. At one p… 173 …we do not want to wake up ReportCrash while the system is low on memory, we maintain one global sn… 175 …_get_jetsam_snapshot` in `bsd/kern/kern_memorystatus.c` for details. Since we only have one global… 179 …and uses it as an input for its freezer recommendation algorithm. However, we're not currently usi… [all …]
|
| H A D | sanitize.md | 152 API requires some additional steps as we want the opaque types to only appear 203 case for syscalls. Therefore we need to modify the mach trap manually to use 216 Now that the internal function definitions see the opaque types, we need to 318 Libsystem or that Libsystem intercepts. For MIG entry points we generate our 320 we sometimes call a `__function_name` entry point exported by Libsystem that 363 size are intertwined (we check for overflow of address+size), so they are
|
| /xnu-11215/doc/allocators/ |
| H A D | read-only.md | 26 By necessity, we store lots of data on the heap that informs the various 28 directly mutable allocations because this fits what we need the memory for: 37 This is where the Read-Only Allocator provides its defense: we observe that 38 the majority of security-sensitive data that we allocate on the heap tends to 46 written programmatically (i.e. through calling a function), we raise the cost 69 relationships, we can validate the ownership invariant that we expect to hold. 90 that we're making conscious, considered choices over which zones are made
|
| /xnu-11215/doc/building/ |
| H A D | bound_checks.md | 25 * when it is disabled, whether we should allow `__indexable` and 29 * when it is set to panic, whether we should optimize for code size at the 38 know where we came from. This manifests as a "function(), file.c:0" call stack 41 On the other hand, we can ask clang to give us one trap instruction per bounds 42 check. In that configuration, we get arguably bad codegen, but the backtrace is 46 To debug a panic in a build optimizing for code size, we can read disassembly 47 and make inferences based on register values. For instance, if we look at one 49 context of our panic we know that `x8` is 0x0 and `x9` is 0x1000, then we know 50 we can't possibly have failed because of that bounds check. There are scripts 171 Once we have confidence that a file doesn't cause issues when -fbounds-safety is [all …]
|
| /xnu-11215/doc/observability/ |
| H A D | mt_stackshot.md | 22 IPI'd into the debugger trap, and we want to avoid overheating the CPU). 84 Each CPU needs its own kcdata descriptor, but we don't know exactly how big each 86 reasonably-sized chunks as we need them. We also want the output to have each 87 task in order (to keep the output identical to singlethreaded stackshot), so we 90 The chunks are sized such that only one is needed for the average task. If we 91 have any extra room at the end of the current chunk once we finish with a task, 92 we can add it to the freelist - but this is not ideal. So, stackshot uses 115 we memcpy the contents of each kcdata chunk into a single buffer, stripping off 137 before (with a single CPU/thread) - with the only difference being that we can 161 estimating it once, we could estimate it for every task to further eliminate
|
| /xnu-11215/san/tools/ |
| H A D | kstksz | 128 -- It is possible that we redord BELOW event as first. Ignore it if we haven't seen 232 …-- When reading from a file, we can't use CoreSymbolication to symbolicate the stack frames as the…
|
| /xnu-11215/tests/ |
| H A D | stackshot_accuracy.m | 53 /* ssh won't let the session die if we still have file handles open to its output. */ 98 /* we should be able to verify delta stackshots */ 207 * given that we've targetted the pid, we can be sure that this 208 * ts_pid will be the pid we expect 247 T_LOG("did we stop because of the limit?: %s", fault_stats.sfs_stopped_faulting ? "yes" : "no"); 254 /* if we couldn't fault the pages back in, then at least verify that we tried */ 295 * then send SIGUSR1 to the parent to let it know that we are done. 347 /* check if we can run the child successfully */
|
| H A D | stackshot_block_owner_14362384.m | 239 /* perform various actions with a mutex in kernel memory. note that, since we aren't allowed 243 * exist in the kernel (to determine if we're running with CONFIG_XNUPOST defined). Else, 291 /* We don't really care what goes into these messages, we're just sending something to a port. */ 346 /* perform various actions with a rwlock in kernel memory. note that, since we aren't allowed 350 * exist in the kernel (to determine if we're running with CONFIG_XNUPOST defined). Else, 512 * This allows us to create a situation in the kernel where we know a thread to be blocked 525 …_create(&waiting, NULL, kmutex_grab_and_wait_thread, NULL); // thread will block until we signal it 634 …; // ping! msg_blocking_thread will now try to test_send_port us stuff, and block until we receive. 646 msg_recv_helper(test_recv_port); // thread should block until we receive one of its messages
|
| H A D | stackshot_tests.m | 93 #define TEST_STACKSHOT_QUEUE_LABEL "houston.we.had.a.problem" 654 /* First kill the child so we can reap it */ 834 * This will mark the test as failed but let it continue so we 854 /* First unwedge the child so we can reap it */ 1055 usleep(1); /* make sure we don't tailcall semaphore_wait */ 1523 T_ASSERT_TRUE(seen_asid, "check that we have seen an ASID"); 2331 * Make sure we're not in a release kernel 2364 /* Check nperflevels to see if we're on an AMP system */ 2930 /* we are dealing with a compressed buffer */ 3076 * Having processed the container, we now only check it [all …]
|
| H A D | test_sysctl_kern_procargs_25397314.m | 58 /* Determine how much memory to allocate. If allocSize is 0 we will use the size 59 * we get from the sysctl for our buffer. */ 85 /* Without KERN_PROCARGS2, we can't tell where argv ends and environ begins.
|
| /xnu-11215/libkern/libkern/c++/ |
| H A D | OSPtr.h | 55 functions. This is great! However, please note that we may \ 63 off on enabling shared pointers in IOKit APIs until we have \
|
| /xnu-11215/config/ |
| H A D | Kasan_disabled.exports | 2 # so we generate an empty export list for non-KASan.
|
| /xnu-11215/san/coverage/ |
| H A D | kcov-blacklist-arm64 | 6 # These use a local variable to work out which stack we're on, but can end up with
|
| /xnu-11215/makedefs/ |
| H A D | MakeInc.def | 153 # NOTE: order matters here. -Wno-xxx goes before opt-in of ones we want 206 # diagnostic here until we've completed that: 601 # Currently we have to keep alive two separated UBSAN runtimes (minimal for DEVELOPMENT, 758 # we're dealing with uintptr_t values here, so explicitly use bash which 831 # for a 16KB page runtime, and we wish to use the first virtual block 834 # multiple of the block size in alignment/length, we will implictly map 835 # it with our block mapping, and we therefore must reflect that the 846 # ensures that we have enough virtual address space to map all of that 895 # llvm-cov, we move the coverage mapping for the kernel itself into the same 977 # SPTM variant. In the future, we should base whether to link the [all …]
|
| H A D | MakeInc.top | 15 # As such, we have no knowledge of how to build 328 # we try to throttle behavior into more managable S "stripes" of N/S 370 # $(1) is the Makefile target we are building for 382 # $(1) is the Makefile target we are building for 388 # $(1) is the Makefile target we are building for
|
| /xnu-11215/libkdd/ |
| H A D | README.md | 73 object for a consumer to understand arbitrary data, we package it using container markers. 89 Following is an example of how we can describe a kernel specific struct sample_disk_io_stats in buf…
|
| H A D | KCDBasicTypeDescription.m | 126 * Calculate the maximum number of data elements we can parse, Taking into 128 * actual length of the data buffer and the offset into the buffer where we
|
| /xnu-11215/san/memory/ |
| H A D | kasan-blacklist-arm64 | 12 # These use a local variable to work out which stack we're on, but can end up with
|
| /xnu-11215/doc/lifecycle/ |
| H A D | hibernation.md | 55 may block, so we have to do this before preemption is disabled). 80 halted, and we are running on the boot CPU's idle thread in the shutdown 154 - On ARM64, we do not support this mode because hibernation is intended to 187 - On ARM64, we have to do this from `hibernate_machine_entrypoint()` because 188 we borrow free pages (as indicated by the page bitmaps) to store the 222 `s_last_absolute_time` test to fail if we don't do this fixup.
|
| /xnu-11215/libsyscall/mach/ |
| H A D | vm_map.defs | 36 * LIBSYSCALL_INTERFACE indicates that we are building the
|
| /xnu-11215/libkern/zlib/ |
| H A D | README | 116 If you use the zlib library in a product, we would appreciate *not* 122 If you redistribute modified sources, we would appreciate that you include
|
| /xnu-11215/doc/debugging/ |
| H A D | debugging.md | 334 After inspecting addkext macro code and calling few functions with arguments directly we can see th… 410 Now we can move a frame above and inspect stopped target: 432 provides the offset to the seek method. Lets see where we are in the source code. 451 That means we are broken by a library update! Older versions of library do not load data for a sect…
|
| /xnu-11215/osfmk/mach/ |
| H A D | doubleagent_mig.defs | 88 out is_empty : boolean_t /* true if we've removed the last xattr in file */
|