pkg/atomicwriter: use sequential file access on Windows#49608
pkg/atomicwriter: use sequential file access on Windows#49608thaJeztah merged 1 commit intomoby:masterfrom
Conversation
|
Opened this for discussion; not 100% sure if there would be cases where we would not want to use this. If that's the case, we could consider adding a |
Using sequential file access ([FILE_FLAG_SEQUENTIAL_SCAN]) prevents Windows from aggressively keeping files in the cache, freeing up system memory for other tasks. On Linux, these changes have no effect, as the sequential package use the standard (os.CreateTemp, os.OpenFile) on non-Windows platforms. Refer to the [Win32 API documentation] for details on sequential file access. [Win32 API documentation]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#FILE_FLAG_SEQUENTIAL_SCAN [FILE_FLAG_SEQUENTIAL_SCAN]: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#FILE_FLAG_SEQUENTIAL_SCAN Signed-off-by: Sebastiaan van Stijn <[email protected]>
305c3b8 to
be6e92a
Compare
|
Could use some input from our Windows-native friends on this one /cc @CharityKathure @profnandaa Let me do a quick outline of my thoughts;
The reason I opened this PR was because I wanted to replace some code in docker/cli with our atomicwriter package; see docker/cli#5914
In general, I'm playing with the idea to move this package to a separate module in the https://github.com/moby/sys repo (i.e., to become |
|
This PR was discussed in the maintainer call last Thursday;
Let me bring this one in 👍 |
pkg/atomicwriter: use sequential file access on Windows
Using sequential file access (FILE_FLAG_SEQUENTIAL_SCAN) prevents
Windows from aggressively keeping files in the cache, freeing up system
memory for other tasks. On Linux, these changes have no effect, as the
sequential package use the standard (os.CreateTemp, os.OpenFile) on
non-Windows platforms. Refer to the Win32 API documentation for details
on sequential file access.
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)