fuse: change to direct io mode
before and after: chrislu$ time dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192 8192+0 records in 8192+0 records out 1073741824 bytes transferred in 4.534068 secs (236816430 bytes/sec) dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192 0.01s user 3.86s system 84% cpu 4.561 total chrislu$ time dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192 8192+0 records in 8192+0 records out 1073741824 bytes transferred in 3.824072 secs (280784948 bytes/sec) dd if=/dev/random of=/Users/chrislu/tmp/mm/testfile bs=131072 count=8192 0.01s user 3.22s system 83% cpu 3.857 total
This commit is contained in:
@@ -175,7 +175,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
|||||||
fuse.DefaultPermissions(),
|
fuse.DefaultPermissions(),
|
||||||
fuse.MaxReadahead(1024 * 128),
|
fuse.MaxReadahead(1024 * 128),
|
||||||
fuse.AsyncRead(),
|
fuse.AsyncRead(),
|
||||||
fuse.WritebackCache(),
|
// fuse.WritebackCache(),
|
||||||
fuse.MaxBackground(128),
|
fuse.MaxBackground(128),
|
||||||
fuse.CongestionThreshold(128),
|
fuse.CongestionThreshold(128),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ func (file *File) Getxattr(ctx context.Context, req *fuse.GetxattrRequest, resp
|
|||||||
func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) {
|
func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error) {
|
||||||
|
|
||||||
glog.V(4).Infof("file %v open %+v", file.fullpath(), req)
|
glog.V(4).Infof("file %v open %+v", file.fullpath(), req)
|
||||||
|
resp.Flags |= fuse.OpenDirectIO
|
||||||
|
|
||||||
handle := file.wfs.AcquireHandle(file, req.Uid, req.Gid)
|
handle := file.wfs.AcquireHandle(file, req.Uid, req.Gid)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user