diff options
author | kmacy <kmacy@FreeBSD.org> | 2012-01-27 20:18:31 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2012-01-27 20:18:31 +0000 |
commit | 84d434965a78b0d9e3e8d915e58cd0bc752d6a25 (patch) | |
tree | d03789c6012846a09fb648b5b7c191277d20df09 /sys/vm | |
parent | ee292f1f00c3658b64c10f59158dda32531a8afb (diff) | |
download | FreeBSD-src-84d434965a78b0d9e3e8d915e58cd0bc752d6a25.zip FreeBSD-src-84d434965a78b0d9e3e8d915e58cd0bc752d6a25.tar.gz |
exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64
excluding other allocations including UMA now entails the addition of
a single flag to kmem_alloc or uma zone create
Reviewed by: alc, avg
MFC after: 2 weeks
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/uma.h | 4 | ||||
-rw-r--r-- | sys/vm/uma_core.c | 3 | ||||
-rw-r--r-- | sys/vm/vm_contig.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_kern.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 5 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 2 |
6 files changed, 18 insertions, 0 deletions
diff --git a/sys/vm/uma.h b/sys/vm/uma.h index fbba22f..e17e6ef 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -248,6 +248,10 @@ int uma_zsecond_add(uma_zone_t zone, uma_zone_t master); * backend pages and can fail early. */ #define UMA_ZONE_VTOSLAB 0x2000 /* Zone uses vtoslab for lookup. */ +#define UMA_ZONE_NODUMP 0x4000 /* + * Zone's pages will not be included in + * mini-dumps. + */ /* * These flags are shared between the keg and zone. In zones wishing to add diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 9fbea55..eaa2faf 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -845,6 +845,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int wait) else wait &= ~M_ZERO; + if (keg->uk_flags & UMA_ZONE_NODUMP) + wait |= M_NODUMP; + /* zone is passed for legacy reasons. */ mem = allocf(zone, keg->uk_ppera * UMA_SLAB_SIZE, &flags, wait); if (mem == NULL) { diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index ea2c904..4deba5b 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -315,6 +315,8 @@ kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; if (flags & M_ZERO) pflags |= VM_ALLOC_ZERO; + if (flags & M_NODUMP) + pflags |= VM_ALLOC_NODUMP; VM_OBJECT_LOCK(object); tries = 0; retry: diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 2c23c48..54f86dd 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -382,6 +382,8 @@ kmem_back(vm_map_t map, vm_offset_t addr, vm_size_t size, int flags) if (flags & M_ZERO) pflags |= VM_ALLOC_ZERO; + if (flags & M_NODUMP) + pflags |= VM_ALLOC_NODUMP; VM_OBJECT_LOCK(kmem_object); for (i = 0; i < size; i += PAGE_SIZE) { diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ee4f2a4..8fec8b0 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1305,6 +1305,7 @@ vm_page_cache_transfer(vm_object_t orig_object, vm_pindex_t offidxstart, * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page * is cached * VM_ALLOC_NOBUSY do not set the flag VPO_BUSY on the page + * VM_ALLOC_NODUMP do not include the page in a kernel core dump * VM_ALLOC_NOOBJ page is not associated with an object and * should not have the flag VPO_BUSY set * VM_ALLOC_WIRED wire the allocated page @@ -1429,6 +1430,8 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) * must be cleared before the free page queues lock is released. */ flags = 0; + if (req & VM_ALLOC_NODUMP) + flags |= PG_NODUMP; if (m->flags & PG_ZERO) { vm_page_zero_count--; if (req & VM_ALLOC_ZERO) @@ -1599,6 +1602,8 @@ retry: flags = 0; if ((req & VM_ALLOC_ZERO) != 0) flags = PG_ZERO; + if ((req & VM_ALLOC_NODUMP) != 0) + flags |= PG_NODUMP; if ((req & VM_ALLOC_WIRED) != 0) atomic_add_int(&cnt.v_wire_count, npages); oflags = VPO_UNMANAGED; diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 85df6fb..ca02de0 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -263,6 +263,7 @@ extern struct vpglocks pa_lock[]; #define PG_MARKER 0x10 /* special queue marker page */ #define PG_SLAB 0x20 /* object pointer is actually a slab */ #define PG_WINATCFLS 0x40 /* flush dirty page on inactive q */ +#define PG_NODUMP 0x80 /* don't include this page in the dump */ /* * Misc constants. @@ -350,6 +351,7 @@ extern struct vpglocks vm_page_queue_lock; #define VM_ALLOC_IFCACHED 0x0400 /* Fail if the page is not cached */ #define VM_ALLOC_IFNOTCACHED 0x0800 /* Fail if the page is cached */ #define VM_ALLOC_IGN_SBUSY 0x1000 /* vm_page_grab() only */ +#define VM_ALLOC_NODUMP 0x2000 /* don't include in dump */ #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) |