Page MenuHomeFreeBSD

Change swp_pager_meta_ctl to swp_pager_meta_lookup

Authored by dougm on Nov 18 2019, 4:26 AM.



Drop the extra argument from swp_pager_meta_ctl and have it do lookup only. Stop checking for obj->type == swap and assert it instead. Move the meta_ctl 'pop' functionality to swap_pager_unswapped, the only place that uses it, and assume obj->type == swap there too.

The assertion added to swap_pager_get_pages_async needs expertimental verification, or a look from someone who knows better when that function gets invoked.

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

Make that a write lock on deletion.

dougm added a subscriber:

Fix a leak pointed out by Ota on a different review thread.

20191118 12:46:52 all (2/12):
panic: Lookup object not swappable
cpuid = 5
time = 1574077630
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00e3f802a0
vpanic() at vpanic+0x17e/frame 0xfffffe00e3f80300
panic() at panic+0x43/frame 0xfffffe00e3f80360
swp_pager_meta_lookup() at swp_pager_meta_lookup+0x68/frame 0xfffffe00e3f80390
swp_pager_xfer_source() at swp_pager_xfer_source+0x66/frame 0xfffffe00e3f803d0
swp_pager_meta_transfer() at swp_pager_meta_transfer+0x1b1/frame 0xfffffe00e3f80450
swap_pager_copy() at swap_pager_copy+0x267/frame 0xfffffe00e3f80480
vm_object_collapse() at vm_object_collapse+0x178/frame 0xfffffe00e3f804f0
vm_object_deallocate() at vm_object_deallocate+0x4b1/frame 0xfffffe00e3f80540
vm_map_process_deferred() at vm_map_process_deferred+0xad/frame 0xfffffe00e3f80560
vm_map_remove() at vm_map_remove+0xeb/frame 0xfffffe00e3f80590
exec_new_vmspace() at exec_new_vmspace+0x186/frame 0xfffffe00e3f805f0
exec_elf64_imgact() at exec_elf64_imgact+0x82a/frame 0xfffffe00e3f806e0
kern_execve() at kern_execve+0x5e9/frame 0xfffffe00e3f80a40
sys_execve() at sys_execve+0x4c/frame 0xfffffe00e3f80ac0
amd64_syscall() at amd64_syscall+0x2d0/frame 0xfffffe00e3f80bf0
fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe00e3f80bf0
--- syscall (59, FreeBSD ELF64, sys_execve), rip = 0x80086675a, rsp = 0x7fffffffe728, rbp = 0x7fffffffe730 ---

Add dstobject->type == OBJT_SWAP test in swp_pager_xfer_source.

This revision is now accepted and ready to land.Nov 18 2019, 3:41 PM

I ran tests with Diff 64526 for 16 hours without seeing any problems.