"BypassIO" für Filter-Treiber gibt mehr Hinweise auf DirectStorage

DPXone

Lieutenant
Registriert
Mai 2009
Beiträge
552
Bin heute über den neuen Parameter "BypassIO" bei fsutil gestolpert (keine Ahnung seit wann der nun existiert).
Build: 22518.1012 (Win 11 - Dev Channel)

Nach kurzer Recherche (die selbst in Google noch an einer Hand abzählbar ist in Verbindung mit "fsutil", aktuell 2 (EN)), kam ich zu folgender MSFT Doku:

https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/bypassio
Github: https://github.com/MicrosoftDocs/wi...taging/windows-driver-docs-pr/ifs/bypassio.md

https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/bypassio-operations
Github: https://github.com/MicrosoftDocs/wi...ows-driver-docs-pr/ifs/bypassio-operations.md

About BypassIO​

Starting in Windows 11, BypassIO was added as an optimized I/O path for reading from files. The goal of this path is to reduce the CPU overhead of doing reads, which helps to meet the I/O demands of loading and running next-generation games on Windows. BypassIO is a part of the infrastructure to support DirectStorage on Windows.

It is important that minifilters implement support for BypassIO, and that you keep BypassIO enabled as much as possible. Without filter support, game performance will be degraded, resulting in a poor gaming experience for end users.

There will be broader application uses beyond gaming in future Windows releases.

BypassIO is a per handle concept. When BypassIO is requested, it is requested for an explicit file handle. BypassIO has no impact on other handles for that file.

FSCTL_MANAGE_BYPASS_IO and an equivalent IOCTL_STORAGE_MANAGE_BYPASS_IO were added as a part of this infrastructure. Minifilters process FSCTL_MANAGE_BYPASS_IO, while IOCTL_STORAGE_MANAGE_BYPASS_IO is sent by file systems to the volume/storage stacks. These control codes are designed to be diagnosable: they both return the identity of the driver that failed the BypassIO request, and the reason for vetoing it.

This page provides architectural details across the file system filter and storage stacks, as well as information on how to implement BypassIO in a minifilter driver. See BypassIO for storage drivers for BypassIO information that is specific to storage drivers.

How BypassIO works​

When NtReadFile is called on a BypassIO-enabled FileHandle, the operation does not flow through the traditional I/O stack, which traverses the entire file system stack, volume stack, and storage stack. Instead, no IRP is issued, and the operation flows directly from the I/O manager to the (NTFS) file system, then to the disk (classpnp) driver, and then to the StorNVMe driver. With a BypassIO-enabled FileHandle:

  • All file system filters are skipped.
  • All volume stack filters are skipped.
  • All storage stack filters and drivers above the disk driver, and between the disk and StorNVMe drivers, are skipped.
1639593522835.png


1639593532271.png

Hier noch die erwähnten Befehle mit Beispielen von meinem PC.
(D:\ ist das Volume auf meiner Samsung SSD 970 EVO Plus 2TB; original MSFT Treiber; kein Bitlocker)
(G: ist nur ein Test mit 128 GB auf derselben NVME SSD für den 4k random write speed drop in Win11 --> ohne USN-Journal kein drop feststellbar; auch auf der genutzen D: nach dem Löschen wiederr normal (via fsutil))


An fsutil command has been added that issues an FSCTL_MANAGE_BYPASS_IO specifying the FS_BPIO_OP_QUERY operation. The displayed results identify the first driver that is preventing BypassIO and the reason why.
Code:
PS> fsutil bypassIo state /v D:

BypassIo on "D:\" is not currently supported
    Status:  506 (At least one minifilter does not support bypass IO)
    Driver:  gameflt
    Reason:  The specified minifilter does not support bypass IO.
    Storage Type:   NVMe
    Storage Driver: Not BypassIo Compatible
    Driver Name:    stornvme.sys

Starting in Windows 11, filter developers should add SUPPORTED_FS_FEATURES_BYPASS_IO to SupportedFeatures in your driver's .INF or MANIFEST files. (You can type fltmc instances in an elevated command prompt to see "SprtFtrs" values for all active filters.)
Code:
PS> fltmc instances

Filter                Volume Name                              Altitude        Instance Name       Frame   SprtFtrs  VlStatus
--------------------  -------------------------------------  ------------  ----------------------  -----   --------  --------
CldFlt                C:                                        180451     CldFlt                    0     0000000f
FileCrypt             D:                                        141100     FileCrypt Instance        0     0000000f
FileInfo                                                         40500     FileInfo                  0     0000000f
FileInfo                                                         40500     FileInfo                  0     0000000f
FileInfo                                                         40500     FileInfo                  0     0000000f
FileInfo              E:                                         40500     FileInfo                  0     0000000f
FileInfo              D:                                         40500     FileInfo                  0     0000000f
FileInfo              G:                                         40500     FileInfo                  0     0000000f
FileInfo                                                         40500     FileInfo                  0     0000000f
FileInfo              C:                                         40500     FileInfo                  0     0000000f
FileInfo              \Device\Mup                                40500     FileInfo                  0     0000000f
WdFilter                                                        328010     WdFilter Instance         0     0000000f
WdFilter                                                        328010     WdFilter Instance         0     0000000f
WdFilter                                                        328010     WdFilter Instance         0     0000000f
WdFilter              E:                                        328010     WdFilter Instance         0     0000000f
WdFilter              D:                                        328010     WdFilter Instance         0     0000000f
WdFilter              G:                                        328010     WdFilter Instance         0     0000000f
WdFilter                                                        328010     WdFilter Instance         0     0000000f
WdFilter              C:                                        328010     WdFilter Instance         0     0000000f
WdFilter              \Device\Mup                               328010     WdFilter Instance         0     0000000f
Wof                                                              40700     Wof Instance              0     0000000f
Wof                                                              40700     Wof Instance              0     0000000f
Wof                                                              40700     Wof Instance              0     0000000f
Wof                   E:                                         40700     Wof Instance              0     0000000f
Wof                   D:                                         40700     Wof Instance              0     0000000f
Wof                   G:                                         40700     Wof Instance              0     0000000f
Wof                   C:                                         40700     Wof Instance              0     0000000f
bfs                                                             150000     bfs                       0     0000000f
bfs                                                             150000     bfs                       0     0000000f
bfs                                                             150000     bfs                       0     0000000f
bfs                   E:                                        150000     bfs                       0     0000000f
bfs                   D:                                        150000     bfs                       0     0000000f
bfs                   G:                                        150000     bfs                       0     0000000f
bfs                                                             150000     bfs                       0     0000000f
bfs                   C:                                        150000     bfs                       0     0000000f
bfs                   \Device\Mailslot                          150000     bfs                       0     0000000f
bfs                   \Device\Mup                               150000     bfs                       0     0000000f
bfs                   \Device\NamedPipe                         150000     bfs                       0     0000000f
bindflt               C:                                        409800     bindflt Instance          0     0000000f
gameflt                                                         189850     gameflt Instance          0     00000003
gameflt                                                         189850     gameflt Instance          0     00000003
gameflt                                                         189850     gameflt Instance          0     00000003
gameflt               E:                                        189850     gameflt Instance          0     00000003
gameflt               D:                                        189850     gameflt Instance          0     00000003
gameflt               G:                                        189850     gameflt Instance          0     00000003
gameflt               C:                                        189850     gameflt Instance          0     00000003
luafv                 C:                                        135000     luafv                     0     0000000f
npsvctrig             \Device\NamedPipe                          46000     npsvctrig                 0     00000008
wcifs                 D:                                        189900     wcifs Instance            0     0000000f

Weitere Erwähnungen:
 
Zuletzt bearbeitet:
  • Gefällt mir
Reaktionen: arvan, Deftract, azereus und 4 andere

Update bzgl. BypassIO Validierung via fsutil:

Im Insider-Build (aktuell: 22543) scheint kein FS-Filtertreiber [MSFT Docs] mehr ByPassIO im Wege zu stehen:
PowerShell:
PS> fsutil bypassIo state /v D:
BypassIo on "D:\" is currently supported
    Storage Type:   NVMe
    Storage Driver: BypassIo compatible
    Driver Name:    stornvme.sys

Auch die explizite Abfrage von Game-Verzeichnissen (z.B. D:\Games\XboxGames\Halo Infinite\Content) oder deren Assemblies oder Assets ergibt dasselbe.



Nochmal hervorheben möchte ich die Aussage von "BypassIO in storage drivers" [MSFT Docs]

Scope of BypassIO support​

Starting in Windows 11, BypassIO is supported as follows:

  • On Windows client systems only. Server system support will be added in a future release.
  • On NVMe storage devices only. Support for other storage technologies will be added in a future release.
  • On the NTFS file system only. Support for other file systems will be added in a future release.
  • Only non-cached reads are supported. Support for non-cached writes will be added in a future release.
  • Only supported on files (not supported on directory or volume handles).



BypassIO hat laut MSFT aber Restriktionen, die in den Docs zu "Supporting BypassIO operations" [MSFT Docs] genannt werden:
The file system will automatically veto a BypassIO enable request for the following types of files:

  • Directories (alternate data streams on a directory can use BypassIO)
  • Volumes (DASD opens)
  • NTFS-compressed files
  • NTFS-encryted files
  • Sparse files
  • Paging files
  • All files on DAX volumes



Folgende Aussage gibt zumindest schon mal eine Vision von DirectStorage durch BypassIO ("BypassIO in storage drivers" [MSFT Docs])
It is important that minifilters implement support for BypassIO, and that you keep BypassIO enabled as much as possible. Without filter support, game performance will be degraded, resulting in a poor gaming experience for end users.

There will be broader application uses beyond gaming in future Windows releases.
 
Zuletzt bearbeitet:
  • Gefällt mir
Reaktionen: arvan
Zurück
Oben