Bug #7016
closedarc_available_memory is not 32-bit safe
100%
Description
upstream DLPX-39446 arc_available_memory is not 32-bit safe
https://github.com/delphix/delphix-os/commit/6b353ea3b8a1610be22e71e657d051743c64190b
related to this upstream:
DLPX-38547 delphix engine hang
https://github.com/delphix/delphix-os/commit/3183a567b3e8c62a74a65885ca60c86f3d693783
DLPX-38547 delphix engine hang (fix static global)
https://github.com/delphix/delphix-os/commit/22ac551d8ef085ad66cc8f65e51ac372b12993b9
DLPX-38882 system hung waiting on free segment
https://github.com/delphix/delphix-os/commit/cdd6beef7548cd3b12f0fc0328eeb3af540079c2
Updated by Igor Kozhukhov over 7 years ago
- Description updated (diff)
- Status changed from New to In Progress
Updated by Matthew Ahrens over 7 years ago
Alexander Motin from FreeBSD report this issue about arc_available_memory on 32-bit systems:
On Wed, Aug 12, 2015 at 1:59 AM, Alexander Motin <mav@freebsd.org
<mailto:mav@freebsd.org>> wrote:
While testing your commit 2ec99e3e987d8aa273f1e9ba2b983557d058198c for
bug 5376 merged to FreeBSD I experienced a problem, which original cause
appeared to be FreeBSD-specific, but then made me think it is partially
possible on Illumos too. There are such parts in that commit:- if (vmem_size(heap_arena, VMEM_FREE) <
- (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) >> 2))
- return (1);
+ n = vmem_size(heap_arena, VMEM_FREE) -
+ (vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC) >> 2);The problem is that vmem_size() returns size_t result, which is uint32_t
on 32-bit platforms. Attempt to convert result of subtraction to int64_t
won't give negative value, but instead something about 2^^32.Am I right? Should there be (int64_t) conversion added before first
vmem_size?
While we are at it, don't let the zio_arena get too full, and add a tunable to control how full it can get. Note that this should not have any impact now that we have the fix for 6914, but it's nice to have the tunable anyway rather than a hard-coded value.
Updated by Electric Monk over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit 0dd053d7d890618ea1fc697b07de364e69eb4190
commit 0dd053d7d890618ea1fc697b07de364e69eb4190 Author: Prakash Surya <prakash.surya@delphix.com> Date: 2016-06-03T15:16:37.000Z 7016 arc_available_memory is not 32-bit safe Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Approved by: Gordon Ross <gordon.ross@nexenta.com>