Blame source/vdo/base/constants.h

Packit b55c50
/*
Packit b55c50
 * Copyright (c) 2020 Red Hat, Inc.
Packit b55c50
 *
Packit b55c50
 * This program is free software; you can redistribute it and/or
Packit b55c50
 * modify it under the terms of the GNU General Public License
Packit b55c50
 * as published by the Free Software Foundation; either version 2
Packit b55c50
 * of the License, or (at your option) any later version.
Packit b55c50
 * 
Packit b55c50
 * This program is distributed in the hope that it will be useful,
Packit b55c50
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit b55c50
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit b55c50
 * GNU General Public License for more details.
Packit b55c50
 * 
Packit b55c50
 * You should have received a copy of the GNU General Public License
Packit b55c50
 * along with this program; if not, write to the Free Software
Packit b55c50
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit b55c50
 * 02110-1301, USA. 
Packit b55c50
 *
Packit b55c50
 * $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/constants.h#2 $
Packit b55c50
 */
Packit b55c50
Packit b55c50
#ifndef CONSTANTS_H
Packit b55c50
#define CONSTANTS_H
Packit b55c50
Packit b55c50
#include "types.h"
Packit b55c50
Packit b55c50
enum {
Packit b55c50
  /** The number of entries on a block map page */
Packit b55c50
  BLOCK_MAP_ENTRIES_PER_PAGE                       = 812,
Packit b55c50
Packit b55c50
  /** The origin of the flat portion of the block map */
Packit b55c50
  BLOCK_MAP_FLAT_PAGE_ORIGIN                       = 1,
Packit b55c50
Packit b55c50
  /**
Packit b55c50
   * The height of a block map tree. Assuming a root count of 60 and 812
Packit b55c50
   * entries per page, this is big enough to represent almost 95 PB of logical
Packit b55c50
   * space.
Packit b55c50
   **/
Packit b55c50
  BLOCK_MAP_TREE_HEIGHT                            = 5,
Packit b55c50
Packit b55c50
  /** The number of trees in the arboreal block map */
Packit b55c50
  DEFAULT_BLOCK_MAP_TREE_ROOT_COUNT                = 60,
Packit b55c50
Packit b55c50
  /** The default size of the recovery journal, in blocks */
Packit b55c50
  DEFAULT_RECOVERY_JOURNAL_SIZE                    = 32 * 1024,
Packit b55c50
Packit b55c50
  /** The default size of each slab journal, in blocks */
Packit b55c50
  DEFAULT_SLAB_JOURNAL_SIZE                        = 224,
Packit b55c50
Packit b55c50
  /**
Packit b55c50
   * The initial size of lbnOperations and pbnOperations, which is based
Packit b55c50
   * upon the expected maximum number of outstanding VIOs. This value was
Packit b55c50
   * chosen to make it highly unlikely that the maps would need to be resized.
Packit b55c50
   **/
Packit b55c50
  LOCK_MAP_CAPACITY                                = 10000,
Packit b55c50
Packit b55c50
  /** The maximum number of logical zones */
Packit b55c50
  MAX_LOGICAL_ZONES                                = 60,
Packit b55c50
Packit b55c50
  /** The maximum number of physical zones */
Packit b55c50
  MAX_PHYSICAL_ZONES                               = 16,
Packit b55c50
Packit b55c50
  /** The base-2 logarithm of the maximum blocks in one slab */
Packit b55c50
  MAX_SLAB_BITS                                    = 23,
Packit b55c50
Packit b55c50
  /** The maximum number of slabs the slab depot supports */
Packit b55c50
  MAX_SLABS                                        = 8192,
Packit b55c50
Packit b55c50
  /**
Packit b55c50
   * The maximum number of block map pages to load simultaneously during
Packit b55c50
   * recovery or rebuild.
Packit b55c50
   **/
Packit b55c50
  MAXIMUM_SIMULTANEOUS_BLOCK_MAP_RESTORATION_READS = 1024,
Packit b55c50
Packit b55c50
  /** The maximum number of VIOs in the system at once */
Packit b55c50
  MAXIMUM_USER_VIOS                                = 2048,
Packit b55c50
Packit b55c50
  /**
Packit b55c50
   * The number of in-memory recovery journal blocks is determined by:
Packit b55c50
   * -- 311 journal entries in a 4k block
Packit b55c50
   * -- maximum of 2048 VIOs making entries at once
Packit b55c50
   * so we need at least 2048 / 312 = 7 journal blocks.
Packit b55c50
   **/
Packit b55c50
  RECOVERY_JOURNAL_TAIL_BUFFER_SIZE                = 64,
Packit b55c50
Packit b55c50
  /** The number of sectors per block */
Packit b55c50
  SECTORS_PER_BLOCK                                = 8,
Packit b55c50
Packit b55c50
  /** The only physical block size supported by VDO */
Packit b55c50
  VDO_BLOCK_SIZE                                   = 4096,
Packit b55c50
Packit b55c50
  /** The size of a sector that will not be torn */
Packit b55c50
  VDO_SECTOR_SIZE                                  = 512,
Packit b55c50
Packit b55c50
  /** The physical block number reserved for storing the zero block */
Packit b55c50
  ZERO_BLOCK                                       = 0,
Packit b55c50
};
Packit b55c50
Packit b55c50
/** The maximum logical space is 4 petabytes, which is 1 terablock. */
Packit b55c50
extern const BlockCount MAXIMUM_LOGICAL_BLOCKS;
Packit b55c50
Packit b55c50
/** The maximum physical space is 256 terabytes, which is 64 gigablocks. */
Packit b55c50
 extern const BlockCount MAXIMUM_PHYSICAL_BLOCKS;
Packit b55c50
Packit b55c50
// unit test minimum
Packit b55c50
extern const BlockCount MINIMUM_SLAB_JOURNAL_BLOCKS;
Packit b55c50
Packit b55c50
#endif // CONSTANTS_H