Bug 274690 - performance degradation due to aslr
Summary: performance degradation due to aslr
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.2-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-24 10:14 UTC by bsdbugs_mr
Modified: 2023-11-04 16:04 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bsdbugs_mr 2023-10-24 10:14:30 UTC
Booting FreeBSD with default tunnables:
kern.elf64.aslr.enable=1
vm.cluster_anon=1

vm.aslr_restarts: 0
xmrig hashrate: 1138
vm.aslr_restarts: 0
running some desktop software from ports tree (browsers, image editors, office etc).
CPU:  3,7% user,  0,0% nice,  2,0% system,  0,3% interrupt, 94,0% idle
Mem: 3825M Active, 3338M Inact, 55M Laundry, 3237M Wired, 16K Buf, 3326M Free
vm.aslr_restarts: 504
exiting from those programs.
CPU:  0,5% user,  0,0% nice,  0,4% system,  0,0% interrupt, 99,1% idle
Mem: 651M Active, 2013M Inact, 16K Laundry, 3147M Wired, 16K Buf, 7964M Free
vm.aslr_restarts: 504
running xmrig to send different SIG* few times.
xmrig: 1140
killall -SIGBUS xmrig
xmrig: 1125
killall -SIGSEGV xmrig
xmrig: 1128
running firefox
killall -SIGSEGV firefox
xmrig: 1115
vm.aslr_restarts: 600
CPU: 14,4% user,  0,0% nice,  1,5% system,  0,1% interrupt, 84,0% idle
Mem: 3037M Active, 2388M Inact, 216K Laundry, 4310M Wired, 16K Buf, 4039M Free

	Second booting FreeBSD with tunnables:
kern.elf64.aslr.enable=0
vm.cluster_anon=2

vm.aslr_restarts: 0
xmrig: 1193
vm.aslr_restarts: 0
running same desktop soft.
CPU:  2,5% user,  0,0% nice,  0,8% system,  0,2% interrupt, 96,6% idle
Mem: 3571M Active, 3510M Inact, 51M Laundry, 3326M Wired, 247K Buf, 3324M Free
vm.aslr_restarts: 0
exitting from runned desktop soft. Running only firefox and chrome to send them SIGSEGV few times.
killall -SIGSEGV firefox
killall -SIGSEGV chrome
CPU:  0,4% user,  0,0% nice,  0,4% system,  0,0% interrupt, 99,2% idle
Mem: 469M Active, 2436M Inact, 528K Laundry, 3174M Wired, 247K Buf, 7701M Free
vm.aslr_restarts: 0
xmrig: 1186
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2023-11-04 16:04:21 UTC
There were some changes to the way address space allocation works when ASLR is enabled, they are in 14.0 but not in 13.2.  It would be worth re-testing with one of the 14.0 release candidates.