Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101990301
D45558.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
D45558.diff
View Options
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2289,22 +2289,17 @@
VM_OBJECT_ASSERT_LOCKED(object);
MPASS((object->flags & OBJ_SWAP) != 0);
- if (pctrie_is_empty(&object->un_pager.swp.swp_blks))
- return (object->size);
sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks,
rounddown(pindex, SWAP_META_PAGES));
if (sb == NULL)
return (object->size);
- if (sb->p < pindex) {
- for (i = pindex % SWAP_META_PAGES; i < SWAP_META_PAGES; i++) {
- if (sb->d[i] != SWAPBLK_NONE)
- return (sb->p + i);
- }
- sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks,
- roundup(pindex, SWAP_META_PAGES));
- if (sb == NULL)
- return (object->size);
+ for (i = pindex - sb->p; i < SWAP_META_PAGES; i++) {
+ if (sb->d[i] != SWAPBLK_NONE)
+ return (sb->p + i);
}
+ sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, pindex);
+ if (sb == NULL)
+ return (object->size);
for (i = 0; i < SWAP_META_PAGES; i++) {
if (sb->d[i] != SWAPBLK_NONE)
return (sb->p + i);
@@ -2314,7 +2309,7 @@
* We get here if a swblk is present in the trie but it
* doesn't map any blocks.
*/
- MPASS(0);
+ __unreachable();
return (object->size);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 6:29 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14506121
Default Alt Text
D45558.diff (1 KB)
Attached To
Mode
D45558: swap_pager: small improvement to find_least
Attached
Detach File
Event Timeline
Log In to Comment