File Index
Files and directories
Sign in
FILE

constants.h

File preview with syntax highlighting.

linux-6.19.14/drivers/md/dm-vdo/constants.h C
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright 2023 Red Hat
 4 */
 5
 6#ifndef VDO_CONSTANTS_H
 7#define VDO_CONSTANTS_H
 8
 9#include <linux/blkdev.h>
10
11#include "types.h"
12
13enum {
14	/*
15	 * The maximum number of contiguous PBNs which will go to a single bio submission queue,
16	 * assuming there is more than one queue.
17	 */
18	VDO_BIO_ROTATION_INTERVAL_LIMIT = 1024,
19
20	/* The number of entries on a block map page */
21	VDO_BLOCK_MAP_ENTRIES_PER_PAGE = 812,
22
23	/* The origin of the flat portion of the block map */
24	VDO_BLOCK_MAP_FLAT_PAGE_ORIGIN = 1,
25
26	/*
27	 * The height of a block map tree. Assuming a root count of 60 and 812 entries per page,
28	 * this is big enough to represent almost 95 PB of logical space.
29	 */
30	VDO_BLOCK_MAP_TREE_HEIGHT = 5,
31
32	/* The default number of bio submission queues. */
33	DEFAULT_VDO_BIO_SUBMIT_QUEUE_COUNT = 4,
34
35	/* The number of contiguous PBNs to be submitted to a single bio queue. */
36	DEFAULT_VDO_BIO_SUBMIT_QUEUE_ROTATE_INTERVAL = 64,
37
38	/* The number of trees in the arboreal block map */
39	DEFAULT_VDO_BLOCK_MAP_TREE_ROOT_COUNT = 60,
40
41	/* The default size of the recovery journal, in blocks */
42	DEFAULT_VDO_RECOVERY_JOURNAL_SIZE = 32 * 1024,
43
44	/* The default size of each slab journal, in blocks */
45	DEFAULT_VDO_SLAB_JOURNAL_SIZE = 224,
46
47	/*
48	 * The initial size of lbn_operations and pbn_operations, which is based upon the expected
49	 * maximum number of outstanding VIOs. This value was chosen to make it highly unlikely
50	 * that the maps would need to be resized.
51	 */
52	VDO_LOCK_MAP_CAPACITY = 10000,
53
54	/* The maximum number of logical zones */
55	MAX_VDO_LOGICAL_ZONES = 60,
56
57	/* The maximum number of physical zones */
58	MAX_VDO_PHYSICAL_ZONES = 16,
59
60	/* The base-2 logarithm of the maximum blocks in one slab */
61	MAX_VDO_SLAB_BITS = 23,
62
63	/* The maximum number of slabs the slab depot supports */
64	MAX_VDO_SLABS = 8192,
65
66	/*
67	 * The maximum number of block map pages to load simultaneously during recovery or rebuild.
68	 */
69	MAXIMUM_SIMULTANEOUS_VDO_BLOCK_MAP_RESTORATION_READS = 1024,
70
71	/* The maximum number of entries in the slab summary */
72	MAXIMUM_VDO_SLAB_SUMMARY_ENTRIES = MAX_VDO_SLABS * MAX_VDO_PHYSICAL_ZONES,
73
74	/* The maximum number of total threads in a VDO thread configuration. */
75	MAXIMUM_VDO_THREADS = 100,
76
77	/* The maximum number of VIOs in the system at once */
78	MAXIMUM_VDO_USER_VIOS = 2048,
79
80	/* The only physical block size supported by VDO */
81	VDO_BLOCK_SIZE = 4096,
82
83	/* The number of sectors per block */
84	VDO_SECTORS_PER_BLOCK = (VDO_BLOCK_SIZE >> SECTOR_SHIFT),
85
86	/* The size of a sector that will not be torn */
87	VDO_SECTOR_SIZE = 512,
88
89	/* The physical block number reserved for storing the zero block */
90	VDO_ZERO_BLOCK = 0,
91};
92
93#endif /* VDO_CONSTANTS_H */
~/ Read-only file preview.