You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flags like O_NOATIME and O_DIRECT need to be passed to the gofer, otherwise they will have no effect to the underlying file (for the filesystems that support them). Apart from file mode, the only flag passed currently is O_TRUNC.
It will likely require a version bump in the gofer.
O_SYNC needs to be handled by goferfs to flush dirty cache pages. It could be added to save the extra syncRemoteFile() call, but it needs to account for gofers that are not file backed. So not worth until someone actually needs it.
Supporting the passing of O_NOATIME and O_DIRECT would require more complex handle sharing in the gofer client.
Currently all reads and writes for an FD go through the backing dentry's read and write handles. I think that has been done to avoid excessive Open RPCs on the same dentry. We would have to special case FDs that are opened with flags like O_NOATIME and O_DIRECT and have special handles for such FDs that were initially opened on remote FS with the right flags.
Note that another level of complexity is that O_DIRECT and O_NOATIME flags can change on an FD via fcntl(F_SETFL). See vfs.SetStatusFlags(). Those flags are only changed on the VFS level. We would have to implement a filesystem hook for file description status flag updates and re-open the handle appropriately if the flags in question have changed.
Yes it would require keeping extra files for the different options. When a file is being open, it would need to check open flags against other open files to try to find one that is compatible. If none are found, creates a new one an add to the list of open files to be matched.
fcntl(2) complicate things a bit :-( It could just ignore them, like we do today. Or reopen the backing file with the new options. This is transparent to the application.
Any update on this issue? I'm looking to benchmark gVisor to other runtimes, but I keep running into O_DIRECT flag issue. Other studies seem to be able to pypass this issue, but I cannot figure how they did it.
Activity
fvoznika commentedon Jan 19, 2021
Dropping from milestone since this is general FS improvement, not specific to VFS2.
ayushr2 commentedon Feb 28, 2021
@fvoznika We should also be passing
O_SYNCto the gofer right?fvoznika commentedon Mar 2, 2021
O_SYNCneeds to be handled by goferfs to flush dirty cache pages. It could be added to save the extrasyncRemoteFile()call, but it needs to account for gofers that are not file backed. So not worth until someone actually needs it.ayushr2 commentedon Mar 5, 2021
Supporting the passing of
O_NOATIMEandO_DIRECTwould require more complex handle sharing in the gofer client.Currently all reads and writes for an FD go through the backing dentry's read and write handles. I think that has been done to avoid excessive
OpenRPCs on the same dentry. We would have to special case FDs that are opened with flags likeO_NOATIMEandO_DIRECTand have special handles for such FDs that were initially opened on remote FS with the right flags.ayushr2 commentedon Mar 6, 2021
Note that another level of complexity is that
O_DIRECTandO_NOATIMEflags can change on an FD viafcntl(F_SETFL). See vfs.SetStatusFlags(). Those flags are only changed on the VFS level. We would have to implement a filesystem hook for file description status flag updates and re-open the handle appropriately if the flags in question have changed.fvoznika commentedon Mar 10, 2021
Yes it would require keeping extra files for the different options. When a file is being open, it would need to check open flags against other open files to try to find one that is compatible. If none are found, creates a new one an add to the list of open files to be matched.
fcntl(2)complicate things a bit :-( It could just ignore them, like we do today. Or reopen the backing file with the new options. This is transparent to the application.WillemDendauw commentedon May 5, 2022
Any update on this issue? I'm looking to benchmark gVisor to other runtimes, but I keep running into O_DIRECT flag issue. Other studies seem to be able to pypass this issue, but I cannot figure how they did it.
gofer: pass O_DIRECT through to host FDs
gofer: pass O_DIRECT through to host FDs
gofer: pass O_DIRECT through to host FDs
gofer: pass O_DIRECT through to host FDs
gofer: pass O_DIRECT through to host FDs