Al-Arvin
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Zoned Namespace (ZNS) SSD 的 overview - (1) ## Feature * 要求單個 zone 內必須順序寫,不同種類的資料可以分配到不同的 zone * 寫完後只能一次性 reset,不能部分 reset () * 單個 ZNS 下面的所有 zone size 必須大小一樣 * Zone Capacity 會小於或等於 Zone Size , 因為 Zone Size 有含無法使用的 block * ![](https://i.imgur.com/7RDv7Yb.png) * 單個 zone size 必須是 LBA 數量的 2 次方 (`2^N`) > * ZNS規範中,將 SSD namespace 的整個 LBA 範圍劃分為若干個等長的區間,等長的 LBA 區間成為一個 zone,每個 zone 內必須以順序的方式進行寫入,每個 zone 有其獨立的狀態機進行管理。 <img src =https://i.imgur.com/nvVxSM9.png width = 500> > LBA 切分 > ![](https://i.imgur.com/qbsN8ab.png) >順序寫 <img src =https://i.imgur.com/dmM9rxX.png width = 400 align = "center"> ## Zone 內部 LBA 分佈情況 zone 只支援 LBA 順序寫,所以單個 zone 內 LBA 呈現連續分佈,寫指標(WP)始終指向下一個順序寫的 LBA 位置,**如果單一 zone 內需要重複寫,需要先進行 zone reset** ![](https://i.imgur.com/gEHaTzw.png) ## Zone Append >The sequential write constraint imposed by the sequential write required zones of host-managed devices has implications on the host IO stack. > 這段話的意思是**所有針對 sequential zone 的寫命令在被裝置接收和執行之前不能被重新排序,否則,將無法滿足順序寫入的要求,導致寫入錯誤。** 在更白話一點的說法是 **「順序寫入的資料來說,資料擺放的順序對於資料本身是有意義的,一旦放置的順序被改動或是錯亂的話,那這些資料就與垃圾無異。」** 但因為 **host IO stacks** 和一些指令傳輸缺乏排序的保證,造成可能無法依照 sequential zone 所期待的對 write commands 進行排序。 想要解決這個問題就必須**控制 write commands 數量為一個**,這樣的作法可以有效的避免寫入的錯誤,但無可避面的效能會因為這樣的做法而下降不少,而這個問題會在輕量的寫入操作的 workload 中特別明顯。 --- 前面鋪陳那麼多接下來就來介紹我們的主角 Zone Append 吧 ~ 由前面所提到的問題進而催生出 Zone Append 這樣的 command 。 > A zone append command is a write operation that specifies the first logical block of a zone as the write position. When executing the command, the device write the data within the zone indicated, but do so at the current zone write pointer position. This change in the write position is automatic and the effective write position for the data is indicated to the host through the command completion information. This mechanism allows a host to simultaneously submit several zone append operations and let the device process these in any order. 這段文字是節錄自 Zoned Storage 官網的 Doc.,他簡單敘述了 Zone Append 的執行方式 ,大致上如下所述 : Zone Append 作為一種寫入操作,在指令的開始階段,它會**指定一個 Zone 的第一個 block**作為寫入的起始位置,指令執行時,controller 會在當前寫指標 ( WP ) 進行寫入,而寫入的位置是會自行變動的 (我認為是在指令完成時,移動 WP,來達成這個機制),而資料寫入的位置會透過指令的完成訊息來告訴 host。 以下是 Write / Zone Append 操作情景比較 : >In the example above, the host must issue to the same zone three different write operations for data A (4KB), B (8KB), and C (16KB). <img src =https://i.imgur.com/9W0SaDg.png width = 500 > ![]() * Write cmd : * 由於被 **sequential write constraint** 所限制,只能在每個 Zone 的 write queue 的 QD (Queue Depth) = 1 時才能安全地完成,也就是說,host 必須等待一個未完成的 write 完成後才能發出下一個 write request 。 * Zone Append : * **在 Zone Append 中,QD 將不在被限制為 1 ,也就是說 host 可以同時送出多個 request** ,但是會因指令的發送時序不同而有不同的寫入順序。 ## Zone Management Commands >Zoned storage devices also provide zone discovery and management commands as extensions of the device basic command set (which is similar to the set of commands defined for regular block devices). 可以使用下列指令管理 Zone : * **RESET ZONE WRITE POINTER** 是 host software 用來將 zone write pointer 的位置重置到 zone 的開頭的指令。執行此指令後,所有寫入該 zone 的資料都會遺失,不能被訪問。 * **OPEN ZONE** 一個 zoned block device 可能需要 internal resources (for example, persistent zone resources)來維護每個 zone。OPEN ZONE 指令**允許應用程式明確地打開一個 zone,並向 device 表明,寫入該 zone 所需的資源應保持可用,直到該 zone 被完全寫入或使用 CLOSE ZONE 指令關閉該區為止。** * **CLOSE ZONE** 允許應用程式明確關閉使用 OPEN ZONE 指令打開的 zone。CLOSE ZONE 向 device 表明,**用於向該 zone 寫入的資源已不再需要,可以釋放。** * **FINISH ZONE** 允許應用程式將一個 zone write pointer 移到該 zone 的末尾,以防止對該 zone 進行任何進一步的寫操作,直到它被 reset。 ## Zone States and State Transitions > Each sequential zone of a zoned storage device has a state attribute that indicates the usage of the blocks within the zone and the device resources that zone uses. The following states are defined. > * **Empty** None of the blocks within the zone contain valid data. >* **Full** All of the blocks within the zone have been written or the zone has been finished by the host using the FINISH ZONE command. >* **Implicit Open** Some blocks in the zone have recently been written by the host. The zone is using device internal resources. >* **Closed** The device internal resources used by a zone were freed explicitly by the host through the execution of a CLOSE ZONE command, or the device implicitly freed the internal resources assigned to the zone to serve write operations targetting different zones. >* **Read Only** The zone can only be read. This state generally corresponds to a defective state of the device, e.g. for a hard-disk, the zone is stored on a platter with a broken write head . >* **Offline** The zone cannot be read nor written. This state generally corresponds to a defective state of the device, e.g. the storage media for the zone is not operating anymore. 把上面的內容白話翻譯一下,Zone 的狀態有以下幾個: * **Full**:zone 被寫滿的狀態 * **Empty**:zone 內部沒有資料的狀態 * **Explicitly Opened**:對 zone 執行 open zone 指令成功後的狀態 * **Implicitly Opened**:對處於 Empty 或者 Closed 狀態的 zone 完成寫資料後的狀態 * **Closed**:還未寫滿的 zone,在 close zone 指令成功後的狀態 * **Read Only**:處於唯讀狀態的 zone * **Offline**:zone 處於異常狀態 <img src ="https://i.imgur.com/fUcugax.png" align="center" height = "500" width = "550"> ###### tags: `SSD` `Zoned Storage` <style> html, body, .ui-content { background-color: #333; color: #ddd; } .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { color: #ddd; } .markdown-body h1, .markdown-body h2 { border-bottom-color: #ffffff69; } .markdown-body h1 .octicon-link, .markdown-body h2 .octicon-link, .markdown-body h3 .octicon-link, .markdown-body h4 .octicon-link, .markdown-body h5 .octicon-link, .markdown-body h6 .octicon-link { color: #fff; } .markdown-body img { background-color: transparent; } .ui-toc-dropdown .nav>.active:focus>a, .ui-toc-dropdown .nav>.active:hover>a, .ui-toc-dropdown .nav>.active>a { color: white; border-left: 2px solid white; } .expand-toggle:hover, .expand-toggle:focus, .back-to-top:hover, .back-to-top:focus, .go-to-bottom:hover, .go-to-bottom:focus { color: white; } .ui-toc-dropdown { background-color: #333; } .ui-toc-label.btn { background-color: #191919; color: white; } .ui-toc-dropdown .nav>li>a:focus, .ui-toc-dropdown .nav>li>a:hover { color: white; border-left: 1px solid white; } .markdown-body blockquote { color: #bcbcbc; } .markdown-body table tr { background-color: #5f5f5f; } .markdown-body table tr:nth-child(2n) { background-color: #4f4f4f; } .markdown-body code, .markdown-body tt { color: #eee; background-color: rgba(230, 230, 230, 0.36); } a, .open-files-container li.selected a { color: #5EB7E0; } </style>

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully