diff options
author | pjd <pjd@FreeBSD.org> | 2008-01-24 11:21:54 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2008-01-24 11:21:54 +0000 |
commit | 435a09e625aa62f4e1a89ab7741d374e4c4d0954 (patch) | |
tree | 5a052f554ed6c25dc2e636388d8d7d93368703a2 /sys/cddl/compat/opensolaris/kern | |
parent | 1c376286e046dbe30549b705bd310d6218ffc824 (diff) | |
download | FreeBSD-src-435a09e625aa62f4e1a89ab7741d374e4c4d0954.zip FreeBSD-src-435a09e625aa62f4e1a89ab7741d374e4c4d0954.tar.gz |
Change type of kmem_used() and kmem_size() functions to uint64_t, so it
doesn't overflow in arc.c in this check:
if (kmem_used() > (kmem_size() * 4) / 5)
return (1);
With this bug ZFS almost doesn't cache.
Only 32bit machines are affected that have vm.kmem_size set to values >=1GB.
Reported by: David Taylor <davidt@yadt.co.uk>
Diffstat (limited to 'sys/cddl/compat/opensolaris/kern')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c index a73349f..e511620 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c @@ -108,18 +108,18 @@ zfs_kmem_free(void *buf, size_t size __unused) free(buf, M_SOLARIS); } -u_long +uint64_t kmem_size(void) { - return ((u_long)vm_kmem_size); + return ((uint64_t)vm_kmem_size); } -u_long +uint64_t kmem_used(void) { - return ((u_long)kmem_map->size); + return ((uint64_t)kmem_map->size); } static int |