Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101976507
D47045.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47045.diff
View Options
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1610,6 +1610,29 @@
vm_object_set_writeable_dirty(object);
}
+/*
+ * vm_page_insert_batch:
+ *
+ * Inserts page array "ma" into the specified object
+ * starting at offset "pindex".
+ *
+ * The object must be locked.
+ */
+static __always_inline int
+vm_page_insert_batch(vm_object_t object, struct pctrie_iter *it,
+ vm_page_t *ma, vm_pindex_t pindex, int npages)
+{
+ int ninserted;
+
+ VM_OBJECT_ASSERT_WLOCKED(object);
+
+ ninserted = vm_radix_insert_batch(it, ma, pindex, npages);
+ if (ninserted > 0)
+ vm_page_insert_radixdone_batch(object, ma, ninserted);
+
+ return (ninserted);
+}
+
/*
* Do the work to remove a page from its object. The caller is responsible for
* updating the page's fields to reflect this removal.
diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h
--- a/sys/vm/vm_radix.h
+++ b/sys/vm/vm_radix.h
@@ -79,6 +79,18 @@
return (VM_RADIX_PCTRIE_ITER_INSERT(pages, page));
}
+/*
+ * Inserts an array of pages into the trie.
+ * Panics if any of the keys already exist.
+ * Returns the number of inserted pages.
+ */
+static __inline int
+vm_radix_insert_batch(struct pctrie_iter *it, vm_page_t *ma,
+ vm_pindex_t pindex, int npages)
+{
+ return (VM_RADIX_PCTRIE_INSERT_BATCH(it, ma, pindex, npages));
+}
+
/*
* Insert the page into the vm_radix tree with its pindex as the key. Panic if
* the pindex already exists. Return zero on success or a non-zero error on
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 1:43 AM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14476851
Default Alt Text
D47045.diff (1 KB)
Attached To
Mode
D47045: vm_radix: Add batch insertion interface
Attached
Detach File
Event Timeline
Log In to Comment