]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/arc.c
Fix ARC behavior on 32-bit systems
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Oct 2017 22:19:19 +0000 (15:19 -0700)
committerGitHub <noreply@github.com>
Tue, 10 Oct 2017 22:19:19 +0000 (15:19 -0700)
commit70f02287f86db33950eba9ceeb4f4c07c23131e0
tree8371dcc7941138ba2245b0c4da05eddb2c809cdd
parent4f23c5d0c45649ba2bb7679c86561b006aee2dfe
Fix ARC behavior on 32-bit systems

With the addition of the ABD changes consumption of the virtual
address space has been greatly reduced.  This exposed an issue on
CONFIG_HIGHMEM systems where free memory was being calculated
incorrectly.  Functionally this didn't cause any major problems
prior to ABD because a lack of available virtual address space
was used as an indicator of low memory.

This patch makes the following changes to address the issue and
in the process realigns the code further with OpenZFS.  There
are no substantive changes in behavior for 64-bit systems.

* Added CONFIG_HIGHMEM case to the arc_all_memory() and
  arc_free_memory() functions to only consider low memory pages
  on CONFIG_HIGHMEM systems.

* The arc_free_memory() function was updated to return bytes
  instead of pages to be consistent with the other helper
  functions.  In user space we make up some reasonable values
  since currently only testing is performed in this context.

* Adds three new values to the arcstats kstat to provide visibility
  in to the ARC's assessment of the memory situation:
  memory_all_bytes, memory_free_bytes, and memory_available_bytes.

* Added kmem_reap() call to arc_available_memory() for 32-bit
  builds to realign code with OpenZFS.

* Reduced size of test file in /async_destroy_001_pos.ksh to
  speed up test case.  Multiple txgs are still required.

* Move vdevs used by zpool_clear_001_pos and zpool_upgrade_002_pos
  to TEST_BASE_DIR location to speed up test cases.

Reviewed-by: David Quigley <david.quigley@intel.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5352
Closes #6734
module/zfs/arc.c
tests/zfs-tests/tests/functional/cli_root/zpool_clear/zpool_clear_001_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade.kshlib
tests/zfs-tests/tests/functional/cli_root/zpool_upgrade/zpool_upgrade_004_pos.ksh
tests/zfs-tests/tests/functional/features/async_destroy/async_destroy_001_pos.ksh