maxusers (thus mbuf etc.) autotuning capped at 384

看板FB_current作者時間13年前 (2012/10/25 03:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
Hi, We have 'maxusers' tunable which affects many other tunables, e.g. number of network mbuf/clusters which is often too low on current machines. There is code in sys/kern/subr_param.c: if (maxusers == 0) { maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; if (maxusers > 384) maxusers = 384; } It was capped to 384 for i386 KVM size limits in r89769, so that amd64, not constrained to 1Gb KVA, suffers from this. I suspect that 384 may be wrong even for i386 today, but let's be conservative and limit maxusers to 384 per 1 Gb of KVM, like this: #define _MAX_MAXUSERS (((VM_MAX_KERNEL_ADDRESS - \ KERNBASE) / (8 * 1024 * 1024)) * 3) if (maxusers == 0) { maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; if (maxusers > _MAX_MAXUSERS) maxusers = _MAX_MAXUSERS; } #undef _MAX_MAXUSERS Any better ideas? -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Anti-Greenpeace][Sober FreeBSD zealot][http://nuclight.livejournal.com] _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1GY3iJ5S (FB_current)
文章代碼(AID): #1GY3iJ5S (FB_current)