-
-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VFS: I think lseek() shouldn't really be a VFS operation. #451
Comments
@raphaelsc did we update the seek operation ? |
On Mon, Sep 29, 2014 at 5:08 AM, slivne [email protected] wrote:
Raphael S. Carvalho |
@raphaelsc - ok, did we do any tests to prove that its performance is now good - so we can close this ? |
On Mon, Sep 29, 2014 at 9:29 AM, slivne [email protected] wrote:
Raphael S. Carvalho |
On Mon, Sep 29, 2014 at 05:44:09AM -0700, Raphael S.Carvalho wrote:
|
On Mon, Sep 29, 2014 at 9:51 AM, Gleb Natapov [email protected]
Raphael S. Carvalho |
On Mon, Sep 29, 2014 at 05:54:52AM -0700, Raphael S.Carvalho wrote:
|
lseek() is a per-fd, not per-vnode operation.
Yet, our sys_lseek() (inherited from Prex, I believe) calls a vnode-specific VOP_SEEK, and holds the vnode lock while doing it.
If we look at implementations of these VOP_SEEK we see that zfs_seek() does some trivial checking and ramfs_seek is a null op. I think we should get rid of this VOP_SEEK. (TODO: check what Linux's VFS does regarding seek).
Currently, we're seeing a slowdown in Cassandra because several threads are doing lseek()/read() concurrently. But I think the problem is the long read() blocking (see issue #450), not the vnode lock in sys_lseek() which should be fairly harmless because it is held for such short durations. I'm not sure whether, even with the change suggested here, we can avoid the (very short-term) vnode lock in sys_lseek(): We may need this lock if we find ourselves needing to check the validity of the file type for example. But in most cases, it is better to avoid the vnode layer at all. E.g.,., I think after someone opens "/dev/console", we don't need to remember this name - the fd can have all the file-operations of the console device - it doesn't need the vfs file-operations and doesn't need "vnode"
The text was updated successfully, but these errors were encountered: