memguard.c (0bfd163f522701b486e066fa2e56624c02f5081a) | memguard.c (44f1c916109d4d88941d257b7c4c96c26ab55477) |
---|---|
1/*- 2 * Copyright (c) 2005, Bosko Milekic <bmilekic@FreeBSD.org>. 3 * Copyright (c) 2010 Isilon Systems, Inc. (http://www.isilon.com/) 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 167 unchanged lines hidden (view full) --- 176 vm_memguard_divisor = 10; 177 /* 178 * Limit consumption of physical pages to 179 * 1/vm_memguard_divisor of system memory. If the KVA is 180 * smaller than this then the KVA limit comes into play first. 181 * This prevents memguard's page promotions from completely 182 * using up memory, since most malloc(9) calls are sub-page. 183 */ | 1/*- 2 * Copyright (c) 2005, Bosko Milekic <bmilekic@FreeBSD.org>. 3 * Copyright (c) 2010 Isilon Systems, Inc. (http://www.isilon.com/) 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 167 unchanged lines hidden (view full) --- 176 vm_memguard_divisor = 10; 177 /* 178 * Limit consumption of physical pages to 179 * 1/vm_memguard_divisor of system memory. If the KVA is 180 * smaller than this then the KVA limit comes into play first. 181 * This prevents memguard's page promotions from completely 182 * using up memory, since most malloc(9) calls are sub-page. 183 */ |
184 mem_pgs = cnt.v_page_count; | 184 mem_pgs = vm_cnt.v_page_count; |
185 memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; 186 /* 187 * We want as much KVA as we can take safely. Use at most our 188 * allotted fraction of the parent map's size. Limit this to 189 * twice the physical memory to avoid using too much memory as 190 * pagetable pages (size must be multiple of PAGE_SIZE). 191 */ 192 memguard_mapsize = round_page(parent_size / vm_memguard_divisor); --- 327 unchanged lines hidden --- | 185 memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; 186 /* 187 * We want as much KVA as we can take safely. Use at most our 188 * allotted fraction of the parent map's size. Limit this to 189 * twice the physical memory to avoid using too much memory as 190 * pagetable pages (size must be multiple of PAGE_SIZE). 191 */ 192 memguard_mapsize = round_page(parent_size / vm_memguard_divisor); --- 327 unchanged lines hidden --- |