mount/fuse: enable fuse real async dio when available

fuse has support for optimized async. direct I/O handling via the
FUSE_ASYNC_DIO init flag. Enable FUSE_ASYNC_DIO when advertised
by fuse.

performance/write-behind: fix dio hang

Also fix a hang observed during aio-stress testing due to conflicting
request handling in write-behind. Overlapping requests are skipped
in pick_winds and may never continue when the conflicting write in
progress returns. Add a wb_process_queue() call after a non-wb request
completes to keep the queue moving.

BUG: 963258
Change-Id: Ifba6e8aba7a7790b288a32067706b75f263105d4
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/5014
Reviewed-by: Anand Avati <avati@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
This commit is contained in:
Brian Foster 2013-05-15 12:30:07 -04:00 committed by Anand Avati
parent 68712c33b4
commit 8a7cda772d
3 changed files with 9 additions and 0 deletions
contrib/fuse-include
xlators
mount/fuse/src
performance/write-behind/src

@ -162,6 +162,7 @@ struct fuse_file_lock {
#define FUSE_BIG_WRITES (1 << 5)
#define FUSE_DONT_MASK (1 << 6)
#define FUSE_DO_READDIRPLUS (1 << 13)
#define FUSE_ASYNC_DIO (1 << 15)
/**
* CUSE INIT request/reply flags

@ -3671,6 +3671,9 @@ fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg)
if (fini->flags & FUSE_DO_READDIRPLUS)
fino.flags |= FUSE_DO_READDIRPLUS;
if (fini->flags & FUSE_ASYNC_DIO)
fino.flags |= FUSE_ASYNC_DIO;
ret = send_fuse_obj (this, finh, &fino);
if (ret == 0)
gf_log ("glusterfs-fuse", GF_LOG_INFO,

@ -1194,12 +1194,17 @@ wb_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata)
{
wb_request_t *req = NULL;
wb_inode_t *wb_inode;
req = frame->local;
frame->local = NULL;
wb_inode = req->wb_inode;
wb_request_unref (req);
/* requests could be pending while this was in progress */
wb_process_queue(wb_inode);
STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf,
xdata);
return 0;