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

From: Andrey V. Elsukov <bu7cher_at_yandex.ru>
Date: Tue, 12 Sep 2017 12:49:40 +0300
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


Received on Tue Sep 12 2017 - 07:53:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC