NVMe Directive 協議相關:
首先Directive 分為Directive Receive command 和 Directive Send command, 顧名思義Directive Send command用於從host trans data 到 device,Directive Receive command反之。
Directive傳送的資料和Directive相關(這不是廢話么)。
Directive傳送的資料主要分兩種類型,Identify和Streams;
1)identify類型,Directive相關信息(包含Streams Directive support相關,Directive/Streams enable之類的)。
2 ) Streams類型,
a.Directive Receive command, 包含Return Parameters、Get Status、Allocate Resources。
Return Parameters: 獲取Max Streams Limit,NVM Subsystem Streams Available、NVM Subsystem Streams Open等等。
Get Status: Open Stream Count, open stream id等。
Allocate Resources:指定host分配給namespace獨占stream numbers,及共享stream numbers。
b.Directive Send command,包含Release Identifier、Release Resources。
NVMe Directive 應用:
廢話不多說,關鍵是directive怎么應用?
從SSD firmware架構來看,Directive streams會增加不小沖擊,原因是host會給不同的數據打上不同的stream id,hot ? cold?large?small?,而且會貫串Firmware前中后,並且給ftl的處理增加巨大難度;那么如何設計NVMe Directive streams才合理呢?
首先要支持streams,最后host與device達成一致,即stream id定義一致,stream id count一致,不宜復雜。
比如只支持2個stream,id = 1表示small data,id = 2表示large data,那么后端可以開辟兩個super block去分別存儲small data or large data。
再比如只支持2個stream,id = 1表示hot data,id = 2表示cold data,那么后端可以把super block分成兩類分別用來存儲hot data or cold data。
NVMe Directive用處:
stream 主要提升 garbage collection 算法的性能,降低SSD寫放大,從而提高 SSD 的有效生命周期。