€•GdŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ1/translations/zh_CN/filesystems/nfs/nfsd-io-modes”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/zh_TW/filesystems/nfs/nfsd-io-modes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/it_IT/filesystems/nfs/nfsd-io-modes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/ja_JP/filesystems/nfs/nfsd-io-modes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/ko_KR/filesystems/nfs/nfsd-io-modes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/sp_SP/filesystems/nfs/nfsd-io-modes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒK/var/lib/git/docbuild/linux/Documentation/filesystems/nfs/nfsd-io-modes.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ NFSD IO MODES”h]”hŒ NFSD IO MODES”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒOverview”h]”hŒOverview”…””}”(hhÌhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÉhžhhŸh³h KubhŒ paragraph”“”)”}”(hŒÓNFSD has historically always used buffered IO when servicing READ and WRITE operations. BUFFERED is NFSD's default IO mode, but it is possible to override that default to use either DONTCACHE or DIRECT IO modes.”h]”hŒÕNFSD has historically always used buffered IO when servicing READ and WRITE operations. BUFFERED is NFSD’s default IO mode, but it is possible to override that default to use either DONTCACHE or DIRECT IO modes.”…””}”(hhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K hhÉhžhubhÛ)”}”(hŒŽExperimental NFSD debugfs interfaces are available to allow the NFSD IO mode used for READ and WRITE to be configured independently. See both:”h]”hŒŽExperimental NFSD debugfs interfaces are available to allow the NFSD IO mode used for READ and WRITE to be configured independently. See both:”…””}”(hhêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ$/sys/kernel/debug/nfsd/io_cache_read”h]”hÛ)”}”(hjh]”hŒ$/sys/kernel/debug/nfsd/io_cache_read”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khhÿubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhhúhžhhŸh³h Nubhþ)”}”(hŒ&/sys/kernel/debug/nfsd/io_cache_write ”h]”hÛ)”}”(hŒ%/sys/kernel/debug/nfsd/io_cache_write”h]”hŒ%/sys/kernel/debug/nfsd/io_cache_write”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhhúhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1høhŸh³h KhhÉhžhubhÛ)”}”(hŒzThe default value for both io_cache_read and io_cache_write reflects NFSD's default IO mode (which is NFSD_IO_BUFFERED=0).”h]”hŒ|The default value for both io_cache_read and io_cache_write reflects NFSD’s default IO mode (which is NFSD_IO_BUFFERED=0).”…””}”(hj6hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhÛ)”}”(hŒ;Based on the configured settings, NFSD's IO will either be:”h]”hŒ=Based on the configured settings, NFSD’s IO will either be:”…””}”(hjDhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhù)”}”(hhh]”(hþ)”}”(hŒ,cached using page cache (NFSD_IO_BUFFERED=0)”h]”hÛ)”}”(hjWh]”hŒ,cached using page cache (NFSD_IO_BUFFERED=0)”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhjUubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjRhžhhŸh³h Nubhþ)”}”(hŒFcached but removed from page cache on completion (NFSD_IO_DONTCACHE=1)”h]”hÛ)”}”(hjnh]”hŒFcached but removed from page cache on completion (NFSD_IO_DONTCACHE=1)”…””}”(hjphžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khjlubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjRhžhhŸh³h Nubhþ)”}”(hŒ6not cached stable_how=NFS_UNSTABLE (NFSD_IO_DIRECT=2) ”h]”hÛ)”}”(hŒ5not cached stable_how=NFS_UNSTABLE (NFSD_IO_DIRECT=2)”h]”hŒ5not cached stable_how=NFS_UNSTABLE (NFSD_IO_DIRECT=2)”…””}”(hj‡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjRhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”j4j5uh1høhŸh³h KhhÉhžhubhÛ)”}”(hŒuTo set an NFSD IO mode, write a supported value (0 - 2) to the corresponding IO operation's debugfs interface, e.g.::”h]”hŒvTo set an NFSD IO mode, write a supported value (0 - 2) to the corresponding IO operation’s debugfs interface, e.g.:”…””}”(hj¡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhhÉhžhubhŒ literal_block”“”)”}”(hŒ\echo 2 > /sys/kernel/debug/nfsd/io_cache_read echo 2 > /sys/kernel/debug/nfsd/io_cache_write”h]”hŒ\echo 2 > /sys/kernel/debug/nfsd/io_cache_read echo 2 > /sys/kernel/debug/nfsd/io_cache_write”…””}”hj±sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j¯hŸh³h K hhÉhžhubhÛ)”}”(hŒ~To check which IO mode NFSD is using for READ or WRITE, simply read the corresponding IO operation's debugfs interface, e.g.::”h]”hŒTo check which IO mode NFSD is using for READ or WRITE, simply read the corresponding IO operation’s debugfs interface, e.g.:”…””}”(hj¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K#hhÉhžhubj°)”}”(hŒRcat /sys/kernel/debug/nfsd/io_cache_read cat /sys/kernel/debug/nfsd/io_cache_write”h]”hŒRcat /sys/kernel/debug/nfsd/io_cache_read cat /sys/kernel/debug/nfsd/io_cache_write”…””}”hjÍsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j¯hŸh³h K&hhÉhžhubhÛ)”}”(hŒ‡If you experiment with NFSD's IO modes on a recent kernel and have interesting results, please report them to linux-nfs@vger.kernel.org”h]”(hŒpIf you experiment with NFSD’s IO modes on a recent kernel and have interesting results, please report them to ”…””}”(hjÛhžhhŸNh NubhŒ reference”“”)”}”(hŒlinux-nfs@vger.kernel.org”h]”hŒlinux-nfs@vger.kernel.org”…””}”(hjåhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ mailto:linux-nfs@vger.kernel.org”uh1jãhjÛubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K)hhÉhžhubeh}”(h]”Œoverview”ah ]”h"]”Œoverview”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒNFSD DONTCACHE”h]”hŒNFSD DONTCACHE”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhžhhŸh³h K-ubhÛ)”}”(hXGDONTCACHE offers a hybrid approach to servicing IO that aims to offer the benefits of using DIRECT IO without any of the strict alignment requirements that DIRECT IO imposes. To achieve this buffered IO is used but the IO is flagged to "drop behind" (meaning associated pages are dropped from the page cache) when IO completes.”h]”hXKDONTCACHE offers a hybrid approach to servicing IO that aims to offer the benefits of using DIRECT IO without any of the strict alignment requirements that DIRECT IO imposes. To achieve this buffered IO is used but the IO is flagged to “drop behind†(meaning associated pages are dropped from the page cache) when IO completes.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K/hjhžhubhÛ)”}”(hXpDONTCACHE aims to avoid what has proven to be a fairly significant limition of Linux's memory management subsystem if/when large amounts of data is infrequently accessed (e.g. read once _or_ written once but not read until much later). Such use-cases are particularly problematic because the page cache will eventually become a bottleneck to servicing new IO requests.”h]”hXrDONTCACHE aims to avoid what has proven to be a fairly significant limition of Linux’s memory management subsystem if/when large amounts of data is infrequently accessed (e.g. read once _or_ written once but not read until much later). Such use-cases are particularly problematic because the page cache will eventually become a bottleneck to servicing new IO requests.”…””}”(hj"hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K5hjhžhubhÛ)”}”(hŒEFor more context on DONTCACHE, please see these Linux commit headers:”h]”hŒEFor more context on DONTCACHE, please see these Linux commit headers:”…””}”(hj0hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhjAubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhj>hžhhŸh³h Nubhþ)”}”(hŒKfor READ: 8026e49bff9b1 ("mm/filemap: add read support for RWF_DONTCACHE")”h]”hÛ)”}”(hŒKfor READ: 8026e49bff9b1 ("mm/filemap: add read support for RWF_DONTCACHE")”h]”hŒOfor READ: 8026e49bff9b1 (“mm/filemap: add read support for RWF_DONTCACHEâ€)”…””}”(hj]hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K@hjYubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhj>hžhhŸh³h Nubhþ)”}”(hŒCfor WRITE: 974c5e6139db3 ("xfs: flag as supporting FOP_DONTCACHE") ”h]”hÛ)”}”(hŒBfor WRITE: 974c5e6139db3 ("xfs: flag as supporting FOP_DONTCACHE")”h]”hŒFfor WRITE: 974c5e6139db3 (“xfs: flag as supporting FOP_DONTCACHEâ€)”…””}”(hjuhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KBhjqubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhj>hžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”j4j5uh1høhŸh³h K>hjhžhubhÛ)”}”(hŒ„NFSD_IO_DONTCACHE will fall back to NFSD_IO_BUFFERED if the underlying filesystem doesn't indicate support by setting FOP_DONTCACHE.”h]”hŒ†NFSD_IO_DONTCACHE will fall back to NFSD_IO_BUFFERED if the underlying filesystem doesn’t indicate support by setting FOP_DONTCACHE.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KDhjhžhubeh}”(h]”Œnfsd-dontcache”ah ]”h"]”Œnfsd dontcache”ah$]”h&]”uh1h´hh¶hžhhŸh³h K-ubhµ)”}”(hhh]”(hº)”}”(hŒ NFSD DIRECT”h]”hŒ NFSD DIRECT”…””}”(hj¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj¥hžhhŸh³h KHubhÛ)”}”(hŒÐDIRECT IO doesn't make use of the page cache, as such it is able to avoid the Linux memory management's page reclaim scalability problems without resorting to the hybrid use of page cache that DONTCACHE does.”h]”hŒÔDIRECT IO doesn’t make use of the page cache, as such it is able to avoid the Linux memory management’s page reclaim scalability problems without resorting to the hybrid use of page cache that DONTCACHE does.”…””}”(hj¶hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KJhj¥hžhubhÛ)”}”(hXËSome workloads benefit from NFSD avoiding the page cache, particularly those with a working set that is significantly larger than available system memory. The pathological worst-case workload that NFSD DIRECT has proven to help most is: NFS client issuing large sequential IO to a file that is 2-3 times larger than the NFS server's available system memory. The reason for such improvement is NFSD DIRECT eliminates a lot of work that the memory management subsystem would otherwise be required to perform (e.g. page allocation, dirty writeback, page reclaim). When using NFSD DIRECT, kswapd and kcompactd are no longer commanding CPU time trying to find adequate free pages so that forward IO progress can be made.”h]”hXÍSome workloads benefit from NFSD avoiding the page cache, particularly those with a working set that is significantly larger than available system memory. The pathological worst-case workload that NFSD DIRECT has proven to help most is: NFS client issuing large sequential IO to a file that is 2-3 times larger than the NFS server’s available system memory. The reason for such improvement is NFSD DIRECT eliminates a lot of work that the memory management subsystem would otherwise be required to perform (e.g. page allocation, dirty writeback, page reclaim). When using NFSD DIRECT, kswapd and kcompactd are no longer commanding CPU time trying to find adequate free pages so that forward IO progress can be made.”…””}”(hjÄhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KNhj¥hžhubhÛ)”}”(hŒ The performance win associated with using NFSD DIRECT was previously discussed on linux-nfs, see: https://lore.kernel.org/linux-nfs/aEslwqa9iMeZjjlV@kernel.org/”h]”(hŒbThe performance win associated with using NFSD DIRECT was previously discussed on linux-nfs, see: ”…””}”(hjÒhžhhŸNh Nubjä)”}”(hŒ>https://lore.kernel.org/linux-nfs/aEslwqa9iMeZjjlV@kernel.org/”h]”hŒ>https://lore.kernel.org/linux-nfs/aEslwqa9iMeZjjlV@kernel.org/”…””}”(hjÚhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jÜuh1jãhjÒubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KZhj¥hžhubhÛ)”}”(hŒBut in summary:”h]”hŒBut in summary:”…””}”(hjïhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K^hj¥hžhubhù)”}”(hhh]”(hþ)”}”(hŒ8NFSD DIRECT can significantly reduce memory requirements”h]”hÛ)”}”(hjh]”hŒ8NFSD DIRECT can significantly reduce memory requirements”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K`hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjýhžhhŸh³h Nubhþ)”}”(hŒDNFSD DIRECT can reduce CPU load by avoiding costly page reclaim work”h]”hÛ)”}”(hjh]”hŒDNFSD DIRECT can reduce CPU load by avoiding costly page reclaim work”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kahjubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjýhžhhŸh³h Nubhþ)”}”(hŒ8NFSD DIRECT can offer more deterministic IO performance ”h]”hÛ)”}”(hŒ7NFSD DIRECT can offer more deterministic IO performance”h]”hŒ7NFSD DIRECT can offer more deterministic IO performance”…””}”(hj2hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kbhj.ubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjýhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”j4j5uh1høhŸh³h K`hj¥hžhubhÛ)”}”(hX.As always, your mileage may vary and so it is important to carefully consider if/when it is beneficial to make use of NFSD DIRECT. When assessing comparative performance of your workload please be sure to log relevant performance metrics during testing (e.g. memory usage, cpu usage, IO performance). Using perf to collect perf data that may be used to generate a "flamegraph" for work Linux must perform on behalf of your test is a really meaningful way to compare the relative health of the system and how switching NFSD's IO mode changes what is observed.”h]”hX4As always, your mileage may vary and so it is important to carefully consider if/when it is beneficial to make use of NFSD DIRECT. When assessing comparative performance of your workload please be sure to log relevant performance metrics during testing (e.g. memory usage, cpu usage, IO performance). Using perf to collect perf data that may be used to generate a “flamegraph†for work Linux must perform on behalf of your test is a really meaningful way to compare the relative health of the system and how switching NFSD’s IO mode changes what is observed.”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kdhj¥hžhubhÛ)”}”(hXEIf NFSD_IO_DIRECT is specified by writing 2 (or 3 and 4 for WRITE) to NFSD's debugfs interfaces, ideally the IO will be aligned relative to the underlying block device's logical_block_size. Also the memory buffer used to store the READ or WRITE payload must be aligned relative to the underlying block device's dma_alignment.”h]”hXKIf NFSD_IO_DIRECT is specified by writing 2 (or 3 and 4 for WRITE) to NFSD’s debugfs interfaces, ideally the IO will be aligned relative to the underlying block device’s logical_block_size. Also the memory buffer used to store the READ or WRITE payload must be aligned relative to the underlying block device’s dma_alignment.”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kmhj¥hžhubhÛ)”}”(hŒNBut NFSD DIRECT does handle misaligned IO in terms of O_DIRECT as best it can:”h]”hŒNBut NFSD DIRECT does handle misaligned IO in terms of O_DIRECT as best it can:”…””}”(hjhhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kshj¥hžhubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒëMisaligned READ: If NFSD_IO_DIRECT is used, expand any misaligned READ to the next DIO-aligned block (on either end of the READ). The expanded READ is verified to have proper offset/len (logical_block_size) and dma_alignment checking. ”h]”(hŒterm”“”)”}”(hŒMisaligned READ:”h]”hŒMisaligned READ:”…””}”(hjƒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h Kzhj}ubhŒ definition”“”)”}”(hhh]”hÛ)”}”(hŒÙIf NFSD_IO_DIRECT is used, expand any misaligned READ to the next DIO-aligned block (on either end of the READ). The expanded READ is verified to have proper offset/len (logical_block_size) and dma_alignment checking.”h]”hŒÙIf NFSD_IO_DIRECT is used, expand any misaligned READ to the next DIO-aligned block (on either end of the READ). The expanded READ is verified to have proper offset/len (logical_block_size) and dma_alignment checking.”…””}”(hj–hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kwhj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‘hj}ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j{hŸh³h Kzhjxubj|)”}”(hXáMisaligned WRITE: If NFSD_IO_DIRECT is used, split any misaligned WRITE into a start, middle and end as needed. The large middle segment is DIO-aligned and the start and/or end are misaligned. Buffered IO is used for the misaligned segments and O_DIRECT is used for the middle DIO-aligned segment. DONTCACHE buffered IO is _not_ used for the misaligned segments because using normal buffered IO offers significant RMW performance benefit when handling streaming misaligned WRITEs. ”h]”(j‚)”}”(hŒMisaligned WRITE:”h]”hŒMisaligned WRITE:”…””}”(hj´hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h Kƒhj°ubj’)”}”(hhh]”hÛ)”}”(hXÎIf NFSD_IO_DIRECT is used, split any misaligned WRITE into a start, middle and end as needed. The large middle segment is DIO-aligned and the start and/or end are misaligned. Buffered IO is used for the misaligned segments and O_DIRECT is used for the middle DIO-aligned segment. DONTCACHE buffered IO is _not_ used for the misaligned segments because using normal buffered IO offers significant RMW performance benefit when handling streaming misaligned WRITEs.”h]”hXÎIf NFSD_IO_DIRECT is used, split any misaligned WRITE into a start, middle and end as needed. The large middle segment is DIO-aligned and the start and/or end are misaligned. Buffered IO is used for the misaligned segments and O_DIRECT is used for the middle DIO-aligned segment. DONTCACHE buffered IO is _not_ used for the misaligned segments because using normal buffered IO offers significant RMW performance benefit when handling streaming misaligned WRITEs.”…””}”(hjÅhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K}hjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1j‘hj°ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j{hŸh³h Kƒhjxhžhubj|)”}”(hX¯Tracing: The nfsd_read_direct trace event shows how NFSD expands any misaligned READ to the next DIO-aligned block (on either end of the original READ, as needed). This combination of trace events is useful for READs:: echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_vector/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_direct/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_io_done/enable echo 1 > /sys/kernel/tracing/events/xfs/xfs_file_direct_read/enable The nfsd_write_direct trace event shows how NFSD splits a given misaligned WRITE into a DIO-aligned middle segment. This combination of trace events is useful for WRITEs:: echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_opened/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_direct/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_io_done/enable echo 1 > /sys/kernel/tracing/events/xfs/xfs_file_direct_write/enable”h]”(j‚)”}”(hŒTracing:”h]”hŒTracing:”…””}”(hjãhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhŸh³h K˜hjßubj’)”}”(hhh]”(hÛ)”}”(hŒšThe nfsd_read_direct trace event shows how NFSD expands any misaligned READ to the next DIO-aligned block (on either end of the original READ, as needed).”h]”hŒšThe nfsd_read_direct trace event shows how NFSD expands any misaligned READ to the next DIO-aligned block (on either end of the original READ, as needed).”…””}”(hjôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K†hjñubhÛ)”}”(hŒ6This combination of trace events is useful for READs::”h]”hŒ5This combination of trace events is useful for READs:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KŠhjñubj°)”}”(hXecho 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_vector/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_direct/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_io_done/enable echo 1 > /sys/kernel/tracing/events/xfs/xfs_file_direct_read/enable”h]”hXecho 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_vector/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_direct/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_read_io_done/enable echo 1 > /sys/kernel/tracing/events/xfs/xfs_file_direct_read/enable”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j¯hŸh³h KŒhjñubhÛ)”}”(hŒsThe nfsd_write_direct trace event shows how NFSD splits a given misaligned WRITE into a DIO-aligned middle segment.”h]”hŒsThe nfsd_write_direct trace event shows how NFSD splits a given misaligned WRITE into a DIO-aligned middle segment.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K‘hjñubhÛ)”}”(hŒ7This combination of trace events is useful for WRITEs::”h]”hŒ6This combination of trace events is useful for WRITEs:”…””}”(hj,hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K”hjñubj°)”}”(hX echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_opened/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_direct/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_io_done/enable echo 1 > /sys/kernel/tracing/events/xfs/xfs_file_direct_write/enable”h]”hX echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_opened/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_direct/enable echo 1 > /sys/kernel/tracing/events/nfsd/nfsd_write_io_done/enable echo 1 > /sys/kernel/tracing/events/xfs/xfs_file_direct_write/enable”…””}”hj:sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j¯hŸh³h K–hjñubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‘hjßubeh}”(h]”h ]”h"]”h$]”h&]”uh1j{hŸh³h K˜hjxhžhubeh}”(h]”h ]”h"]”h$]”h&]”uh1jvhj¥hžhhŸh³h Nubeh}”(h]”Œ nfsd-direct”ah ]”h"]”Œ nfsd direct”ah$]”h&]”uh1h´hh¶hžhhŸh³h KHubeh}”(h]”Œ nfsd-io-modes”ah ]”h"]”Œ nfsd io modes”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jgjdjjýj¢jŸj_j\uŒ nametypes”}”(jg‰j‰j¢‰j_‰uh}”(jdh¶jýhÉjŸjj\j¥uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.