diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-08-27 18:29:46 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-09-28 16:43:22 +0200 |
commit | ae2dffa39485c6fd4f22321814c7287c274b473a (patch) | |
tree | ae65ad5f3ac4f02fb9f7ba8b7fce89cac5d565bf /fs/fuse/fuse_i.h | |
parent | 2b30a533148af4f3865c0dcd619ad93ab3f4ba52 (diff) | |
download | lwn-ae2dffa39485c6fd4f22321814c7287c274b473a.tar.gz lwn-ae2dffa39485c6fd4f22321814c7287c274b473a.zip |
fuse: introduce fc->bg_lock
To reduce contention of fc->lock, this patch introduces bg_lock for
protection of fields related to background queue. These are:
max_background, congestion_threshold, num_background, active_background,
bg_queue and blocked.
This allows next patch to make async reads not requiring fc->lock, so async
reads and writes will have better performance executed in parallel.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 3e45d408a644..d6d55641a5a6 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -500,6 +500,10 @@ struct fuse_conn { /** The list of background requests set aside for later queuing */ struct list_head bg_queue; + /** Protects: max_background, congestion_threshold, num_background, + * active_background, bg_queue, blocked */ + spinlock_t bg_lock; + /** Flag indicating that INIT reply has been received. Allocating * any fuse request will be suspended until the flag is set */ int initialized; @@ -860,8 +864,8 @@ ssize_t fuse_simple_request(struct fuse_conn *fc, struct fuse_args *args); */ void fuse_request_send_background(struct fuse_conn *fc, struct fuse_req *req); -void fuse_request_send_background_locked(struct fuse_conn *fc, - struct fuse_req *req); +void fuse_request_send_background_nocheck(struct fuse_conn *fc, + struct fuse_req *req); /* Abort all requests */ void fuse_abort_conn(struct fuse_conn *fc, bool is_abort); |