Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153190011
D22256.id63991.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
865 B
Referenced Files
None
Subscribers
None
D22256.id63991.diff
View Options
Index: sys/vm/swap_pager.c
===================================================================
--- sys/vm/swap_pager.c
+++ sys/vm/swap_pager.c
@@ -985,7 +985,18 @@
* Transfer source to destination.
*/
swp_pager_init_freerange(&s_free, &n_free);
- for (i = 0; i < dstobject->size; ++i) {
+
+ /*
+ * Search srcobject pindex of corresponding dstobject between 0 and
+ * dstobject->size to transfer.
+ *
+ * Based on experiments, about 80% to 95% of vm_indexes are
+ * SWAPBLK_NONE. Calling swap_pager_find_least() adds extra
+ * pctrie lookups. However, skipping SWAPBLK_NONE gives us saving
+ * of pctrie lookups in total.
+ */
+ for (i = 0; (i = swap_pager_find_least(srcobject, i + offset) - offset)
+ < dstobject->size; ++i) {
srcaddr = swp_pager_meta_ctl(srcobject, i + offset, SWM_POP);
if (srcaddr == SWAPBLK_NONE)
continue;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 5:09 PM (8 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31852733
Default Alt Text
D22256.id63991.diff (865 B)
Attached To
Mode
D22256: Skip SWAPBLK_NONEs with swap_pager_find_least() in swap_pager_copy().
Attached
Detach File
Event Timeline
Log In to Comment