OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
_DATA_BUF_ENTRY Struct Reference

The structure of the data buffer entry. More...

#include <data_buffer.h>

Data Fields

unsigned int logicalSliceAddr
 
unsigned int prevEntry: 16
 
unsigned int nextEntry: 16
 
unsigned int blockingReqTail: 16
 
unsigned int hashPrevEntry: 16
 
unsigned int hashNextEntry: 16
 
unsigned int dirty: 1
 
unsigned int reserved0: 15
 

Detailed Description

The structure of the data buffer entry.

Since only a limited number of data buffer entries could be maintained in DRAM, the fw must reuse the data buffer entries by maintaining a LRU list which is consist of data buffer entries.

The nodes of the LRU list are linked using the two members prevEntry and nextEntry of this structure.

  • When a data buffer entry is allocated to a request, the allocated data buffer entry will be move to the head of the LRU list.
  • When there is no free data buffer entry can be used to serve the newly created slice request, the fw will reuse the tail entry of the LRU list, and evict the data if the flag dirty of that entry is marked as true.
  • Besides storing the data needed by the requests, the data buffer entries are also used as cache to speed up the read/write requests. When a new request is created the fw should first check if there is any data buffer entry cached the data needed by the new request (check ReqTransSliceToLowLevel() and CheckDataBufHit() for details).

    However, if we simply traverse the LRU list every time we want to check the data buffer, it may be too slow. Therefore, in current implementation, the fw maintains a hash table to reduce the overhead for searching the target data buffer entry that owns the data of target LBA. And the nodes of the hash table are linked together by using the two members hashPrevEntry and hashNextEntry of this structure.

See also
AllocateDataBuf(), CheckDataBufHit(), EvictDataBufEntry().

Also, since a data buffer may be shared by several requests, every data buffer entry maintains a blocking request queue (by using SSD_REQ_FORMAT::(prev|next)BlockingReq, and DATA_BUF_ENTRY::blockingReqTail) to make sure the requests will be executed in correct order (check UpdateDataBufEntryInfoBlockingReq() for details).

See also
UpdateDataBufEntryInfoBlockingReq().

Definition at line 102 of file data_buffer.h.

Field Documentation

◆ blockingReqTail

unsigned int _DATA_BUF_ENTRY::blockingReqTail

Definition at line 107 of file data_buffer.h.

◆ dirty

unsigned int _DATA_BUF_ENTRY::dirty

Definition at line 110 of file data_buffer.h.

◆ hashNextEntry

unsigned int _DATA_BUF_ENTRY::hashNextEntry

Definition at line 109 of file data_buffer.h.

◆ hashPrevEntry

unsigned int _DATA_BUF_ENTRY::hashPrevEntry

Definition at line 108 of file data_buffer.h.

◆ logicalSliceAddr

unsigned int _DATA_BUF_ENTRY::logicalSliceAddr

Definition at line 104 of file data_buffer.h.

◆ nextEntry

unsigned int _DATA_BUF_ENTRY::nextEntry

Definition at line 106 of file data_buffer.h.

◆ prevEntry

unsigned int _DATA_BUF_ENTRY::prevEntry

Definition at line 105 of file data_buffer.h.

◆ reserved0

unsigned int _DATA_BUF_ENTRY::reserved0

Definition at line 111 of file data_buffer.h.


The documentation for this struct was generated from the following file: