Fix integer math overflow in UMA hash_alloc().

512GB of ZFS ABD ARC means abd_chunk zone of 128M 4KB items.  To manage
them UMA tries to allocate 2GB hash table, which size does not fit into
the int variable, causing later allocation failure, which makes ARC shrink
back below the 512GB, not letting it to use more RAM.  With this change I
easily reached >700GB ARC size on 768GB RAM machine.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
This commit is contained in:
mav 2019-02-02 04:11:59 +00:00
parent 388de14948
commit 7aad216459

View File

@ -623,7 +623,7 @@ static int
hash_alloc(struct uma_hash *hash)
{
int oldsize;
int alloc;
size_t alloc;
oldsize = hash->uh_hashsize;