2018-06-29 12:09:03 +03:00
/*
2022-06-24 16:54:08 +03:00
* Copyright ( C ) 2018 - 2022 Red Hat , Inc . All rights reserved .
2018-06-29 12:09:03 +03:00
*
* This file is part of the device - mapper userspace tools .
*
* This copyrighted material is made available to anyone wishing to use ,
* modify , copy , or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v .2 .1 .
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
*/
# ifndef DEVICE_MAPPER_VDO_LIMITS_H
# define DEVICE_MAPPER_VDO_LIMITS_H
2022-06-24 16:54:08 +03:00
# ifndef SECTOR_SHIFT
# define SECTOR_SHIFT 9L
# endif
2018-06-29 12:09:03 +03:00
# define DM_VDO_BLOCK_SIZE UINT64_C(8) // 4KiB in sectors
2022-06-24 16:54:08 +03:00
# define DM_VDO_BLOCK_SIZE_KB (DM_VDO_BLOCK_SIZE << SECTOR_SHIFT)
2018-06-29 12:09:03 +03:00
# define DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_MB (128) // 128MiB
# define DM_VDO_BLOCK_MAP_CACHE_SIZE_MAXIMUM_MB (16 * 1024 * 1024 - 1) // 16TiB - 1
# define DM_VDO_BLOCK_MAP_CACHE_SIZE_MINIMUM_PER_LOGICAL_THREAD (4096 * DM_VDO_BLOCK_SIZE_KB)
2022-06-24 16:54:08 +03:00
# define DM_VDO_BLOCK_MAP_ERA_LENGTH_MINIMUM 1
# define DM_VDO_BLOCK_MAP_ERA_LENGTH_MAXIMUM 16380
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_INDEX_MEMORY_SIZE_MINIMUM_MB 256 // 0.25 GiB
2018-06-29 12:09:03 +03:00
# define DM_VDO_INDEX_MEMORY_SIZE_MAXIMUM_MB (1024 * 1024 * 1024) // 1TiB
2022-06-24 16:54:08 +03:00
# define DM_VDO_SLAB_SIZE_MINIMUM_MB 128 // 128MiB
2018-06-29 12:09:03 +03:00
# define DM_VDO_SLAB_SIZE_MAXIMUM_MB (32 * 1024) // 32GiB
2022-06-24 16:54:08 +03:00
# define DM_VDO_SLABS_MAXIMUM 8192
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_LOGICAL_SIZE_MAXIMUM (UINT64_C(4) * 1024 * 1024 * 1024 * 1024 * 1024 >> SECTOR_SHIFT) // 4PiB
# define DM_VDO_PHYSICAL_SIZE_MAXIMUM (UINT64_C(64) * DM_VDO_BLOCK_SIZE_KB * 1024 * 1024 * 1024 >> SECTOR_SHIFT) // 256TiB
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_ACK_THREADS_MINIMUM 0
# define DM_VDO_ACK_THREADS_MAXIMUM 100
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_BIO_THREADS_MINIMUM 1
# define DM_VDO_BIO_THREADS_MAXIMUM 100
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_BIO_ROTATION_MINIMUM 1
# define DM_VDO_BIO_ROTATION_MAXIMUM 1024
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_CPU_THREADS_MINIMUM 1
# define DM_VDO_CPU_THREADS_MAXIMUM 100
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_HASH_ZONE_THREADS_MINIMUM 0
# define DM_VDO_HASH_ZONE_THREADS_MAXIMUM 100
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_LOGICAL_THREADS_MINIMUM 0
# define DM_VDO_LOGICAL_THREADS_MAXIMUM 60
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_PHYSICAL_THREADS_MINIMUM 0
# define DM_VDO_PHYSICAL_THREADS_MAXIMUM 16
2018-06-29 12:09:03 +03:00
2022-06-24 16:54:08 +03:00
# define DM_VDO_MAX_DISCARD_MINIMUM 1
# define DM_VDO_MAX_DISCARD_MAXIMUM (UINT32_MAX / (uint32_t)(DM_VDO_BLOCK_SIZE_KB))
2018-12-20 15:17:30 +03:00
2018-06-29 12:09:03 +03:00
# endif // DEVICE_MAPPER_VDO_LIMITS_H