r323412: Panic on boot (slab->us_keg == keg)

Andrey V. Elsukov bu7cher at yandex.ru
Tue Sep 12 09:53:44 UTC 2017


On 12.09.2017 06:35, Mark Johnston wrote:
>> [...]
>> FreeBSD/SMP: 2 package(s) x 14 core(s) x 2 hardware threads
>>
>> Also I determined that it can successfully boot with disabled
>> hyper-threading.
> 
> After the change to CACHE_LINE_SIZE, we have
> sizeof(struct uma_zone) == 448 and sizeof(struct uma_cache) == 64. With
> 56 CPUs, we therefore need 4032 bytes per UMA zone, plus 80 bytes for
> the slab header - "internal" zones always keep the slab header in the
> slab itself. That's slightly larger than one page, but the UMA zone
> zone's keg will have uk_ppera == 1. So, when allocating slabzone,
> keg_alloc_slab() will call startup_alloc(uk_ppera * PAGE_SIZE), which
> will allocate 4096 bytes for a structure that is 4032 + 80 = 4112 bytes
> in size.
> 
> I think the bug is that keg_large_init() doesn't take
> sizeof(struct uma_slab) into account when setting uk_ppera for the keg.
> In particular, the bug isn't specific to the bootup process; it only
> affects internal zones with an item size in the range [4016, 4096].
> 
> The patch below should fix this - could you give it a try?
Hi Mark,

I can confirm that it fixes this panic. Thanks!

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20170912/47409d41/attachment.sig>


More information about the freebsd-current mailing list