summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_phys.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-11-16 16:46:09 +0000
committeralc <alc@FreeBSD.org>2011-11-16 16:46:09 +0000
commit3692d0165926e89d0ad0d746888b510d4e49348c (patch)
tree272387d8a035403f23822efe5dfd1df09f424088 /sys/vm/vm_phys.h
parent1c37e71ee838a9da8d383e6e57d29d25820b52d5 (diff)
downloadFreeBSD-src-3692d0165926e89d0ad0d746888b510d4e49348c.zip
FreeBSD-src-3692d0165926e89d0ad0d746888b510d4e49348c.tar.gz
Refactor the code that performs physically contiguous memory allocation,
yielding a new public interface, vm_page_alloc_contig(). This new function addresses some of the limitations of the current interfaces, contigmalloc() and kmem_alloc_contig(). For example, the physically contiguous memory that is allocated with those interfaces can only be allocated to the kernel vm object and must be mapped into the kernel virtual address space. It also provides functionality that vm_phys_alloc_contig() doesn't, such as wiring the returned pages. Moreover, unlike that function, it respects the low water marks on the paging queues and wakes up the page daemon when necessary. That said, at present, this new function can't be applied to all types of vm objects. However, that restriction will be eliminated in the coming weeks. From a design standpoint, this change also addresses an inconsistency between vm_phys_alloc_contig() and the other vm_phys_alloc*() functions. Specifically, vm_phys_alloc_contig() manipulated vm_page fields that other functions in vm/vm_phys.c didn't. Moreover, vm_phys_alloc_contig() knew about vnodes and reservations. Now, vm_page_alloc_contig() is responsible for these things. Reviewed by: kib Discussed with: jhb
Diffstat (limited to 'sys/vm/vm_phys.h')
-rw-r--r--sys/vm/vm_phys.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h
index 847a633..047e4a9 100644
--- a/sys/vm/vm_phys.h
+++ b/sys/vm/vm_phys.h
@@ -49,6 +49,9 @@ struct mem_affinity {
extern struct mem_affinity *mem_affinity;
+/*
+ * The following functions are only to be used by the virtual memory system.
+ */
void vm_phys_add_page(vm_paddr_t pa);
vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
u_long alignment, vm_paddr_t boundary);
OpenPOWER on IntegriCloud