2019年10月12日 星期六

tmpfs

virtual file systems 就應用程式而言,跟其它檔案系統一樣使用 open(), read(), write(), link(), mkdir() 等對檔案和目錄操作,但存在記憶體的關係,速度會較快。

tmpfs 使用 RAM 和 swap,kernel 設定是 CONFIG_TMPFS

建立 tmpfs 檔案系統只需要直接掛載它
mount -t tmpfs name mount_point
name 只是顯示在 /proc/mounts,或指令 mount 或 df 的名稱。
mount_point 是掛載點
tmpfs 檔案系統動態調整大小,預設上限是 RAM 的一半,size=nbytes 選項可限制上限。

除了作為一般檔案系統,tmpfs 有兩種特殊用途:
  • kernel 內部掛載一個不可見的 tmpfs 作為 System V shared memory (TLPI §48) 和 shared anonymous memory mappings (TLPI §49)。
  • 掛載在 /dev/shm 的 tmpfs 作為 glibc 實作的 POSIX shared memory 和 POSIX semaphores。
參考:
TLPI §14.10

沒有留言:

張貼留言

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...