Blame source/vdo/base/constants.h

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