From 7aad216459fa7e1586090c3d23e0f34e5225a917 Mon Sep 17 00:00:00 2001 From: mav Date: Sat, 2 Feb 2019 04:11:59 +0000 Subject: [PATCH] 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. --- sys/vm/uma_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 809bb7c2393f..c2571f1c4153 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -623,7 +623,7 @@ static int hash_alloc(struct uma_hash *hash) { int oldsize; - int alloc; + size_t alloc; oldsize = hash->uh_hashsize;