Skip to content

Miscellaneous

Petros Koutoupis edited this page Aug 8, 2022 · 3 revisions

RapidDisk kernel module ioctls

This section contains a list of all supported IOCTL commands for an rxdsk created volume.

Currently supported

As defined in include/linux/fs.h:

  • BLKGETSIZE
  • BLKGETSIZE64
  • BLKPBSZGET
  • BLKBSZGET
  • BLKSSZGET
  • BLKFLSBUF

As defined in the rxdsk.c source file of the module, the following are for special cases:

  • #define INVALID_CDQUERY_IOCTL 0×5331
  • #define RD_GET_STATS 0×0529
  • #define RD_GET_USAGE 0x0530

The INVALID_CDQUERY_IOCTL macro was implemented to work around an issue surfaced in later versions of udev in which, udev is unsure of the type of device and assuming that it may be a CDROM device, it sends an CDROM_GET_CAPABILITY (defined in include/linux/cdrom as 0×5331). This causes a couple of problems when creating an accessing the rxdsk block node. The macro was defined so we can appropriately return an -EINVAL upon detection.

The RD_GET_STATS macro was implemented for possible future support of obtaining statistics for that RapidDisk volume but for now, it only reports the maximum accessed sector (max_blk_alloc in the rdsk_device structure) for archival/restoring support in the rapiddisk administration utility.

The RD_GET_USAGE macro was implemented to retrieve a total number of pages allocated for the RapidDisk volume. When pages are invalidated, this value will update to reflect that.

RapidDisk Return Values

Each supported command will return its respective values. The RapidDisk block device will return an -ENOTTY if the command is not supported.

Understanding the RapidDisk-Cache Statistics

Normal output

0 78156289 rapiddisk-cache stats:
        reads(1108), writes(297349)
        cache hits(699), replacement(134), write replacement(146086)
        read invalidates(2), write invalidates(34)
        uncached reads(7), uncached writes(13328)
        disk reads(409), disk writes(297349)
        cache reads(699), cache writes(284423)

JSON output

{
   "statistics": [
    {
      "cache_stats": [
        {
          "device": "rc-wt_sdf",
          "reads": 1108,
          "writes": 297349,
          "cache_hits": 699,
          "replacement": 134,
          "write_replacement": 146086,
          "read_invalidates": 2,
          "write_invalidates": 34,
          "uncached_reads": 7,
          "uncached_writes": 13328,
          "disk_reads": 409,
          "disk_writes": 297349,
          "cache_reads": 699,
          "cache_writes": 284423
        }
      ]
    }
  ]
}

Translation

device: RapidDisk-Cache device name.

reads: Number of total reads to the RapidDisk-Cache front-node device. That means total reads that will hit both the cache and backing store devices.

writes: Number of total writes to the RapidDisk-Cache front-node device. That means total writes that will hit both the cache and backing store devices.

cache_hits: Number of read/write operations that hit the cache device.

replacement: Follows a cache miss, where blocks are replaced into the cache device.

write_replacement: Writes replaced out of the cache. Will be "0" in WA mode.

read_invalidates: Invalidated overlapping read cache blocks.

write_invalidates: Invalidated overlapping write cache blocks.

uncached_reads: Backing store reads that were not cached.

uncached_writes: Backing store writes that were not cached.

disk_reads: Reads from the backing store device.

disk_writes: Writes to the backing store device.

cache_reads: Reads from the cache device.

cache_writes: Writes to the cache device.