X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/143464d58d2bd6378e74eec636961ceb0d32fb91..fe8ab488e9161c46dd9885d58fc52996dc0249ff:/osfmk/vm/vm_compressor_backing_store.h diff --git a/osfmk/vm/vm_compressor_backing_store.h b/osfmk/vm/vm_compressor_backing_store.h index 6cced5b2f..fd2ba4bd0 100644 --- a/osfmk/vm/vm_compressor_backing_store.h +++ b/osfmk/vm/vm_compressor_backing_store.h @@ -39,23 +39,6 @@ #include -#define SANITY_CHECK_SWAP_ROUTINES 0 - -#if SANITY_CHECK_SWAP_ROUTINES - -#define MIN_SWAP_FILE_SIZE (4 * 1024) - -#define MAX_SWAP_FILE_SIZE (4 * 1024) - -#define COMPRESSED_SWAP_CHUNK_SIZE (4 * 1024) - -#define VM_SWAPFILE_HIWATER_SEGS (MIN_SWAP_FILE_SIZE / COMPRESSED_SWAP_CHUNK_SIZE) - -#define SWAPFILE_RECLAIM_THRESHOLD_SEGS (MIN_SWAP_FILE_SIZE / COMPRESSED_SWAP_CHUNK_SIZE) - -#else /* SANITY_CHECK_SWAP_ROUTINES */ - - #define MIN_SWAP_FILE_SIZE (256 * 1024 * 1024) #define MAX_SWAP_FILE_SIZE (1 * 1024 * 1024 * 1024) @@ -65,13 +48,15 @@ #define VM_SWAPFILE_HIWATER_SEGS (MIN_SWAP_FILE_SIZE / COMPRESSED_SWAP_CHUNK_SIZE) -#define SWAPFILE_RECLAIM_THRESHOLD_SEGS ((15 * (MAX_SWAP_FILE_SIZE / COMPRESSED_SWAP_CHUNK_SIZE)) / 10) +#define SWAPFILE_RECLAIM_THRESHOLD_SEGS ((17 * (MAX_SWAP_FILE_SIZE / COMPRESSED_SWAP_CHUNK_SIZE)) / 10) +#define SWAPFILE_RECLAIM_MINIMUM_SEGS ((13 * (MAX_SWAP_FILE_SIZE / COMPRESSED_SWAP_CHUNK_SIZE)) / 10) -#endif /* SANITY_CHECK_SWAP_ROUTINES */ #define SWAP_FILE_NAME "/var/vm/swapfile" #define SWAPFILENAME_LEN (int)(strlen(SWAP_FILE_NAME)) -#define SWAPFILENAME_INDEX_LEN 2 /* Doesn't include the terminating NULL character */ + +char swapfilename[MAX_SWAPFILENAME_LEN + 1]; + #define SWAP_SLOT_MASK 0x1FFFFFFFF #define SWAP_DEVICE_SHIFT 33