Skip to content

Conversation

d-hans
Copy link
Contributor

@d-hans d-hans commented Apr 8, 2022

This patch allows parallel direct writes on the same file to be enabled with the help of a flag FOPEN_PARALLEL_DIRECT_WRITES. FUSE implementations which want to use this feature
can set this flag during fuse init. Default behavior remains same i.e no parallel direct writes on
the same file.

Corresponding fuse kernel patch(Merged).
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2&id=153524053bbb0d27bb2e0be36d1b46862e9ce74c

@Nikratio
Copy link
Contributor

Nikratio commented Apr 8, 2022

Thanks! Could you please ping this request once the necessary patches have been merged into the kernel?

@Nikratio Nikratio marked this pull request as draft April 17, 2022 12:47
Copy link
Collaborator

@bsbernd bsbernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for parallel writes is released in linux/6.2 (commit 153524053bbb0d27bb2e0be36d1b46862e9ce74c).

lib/fuse.c Outdated
@@ -4669,6 +4675,7 @@ static const struct fuse_opt fuse_lib_opts[] = {
FUSE_LIB_OPT("noforget", remember, -1),
FUSE_LIB_OPT("remember=%u", remember, 0),
FUSE_LIB_OPT("modules=%s", modules, 0),
FUSE_LIB_OPT("parallel_direct_write=%d",parallel_direct_writes, 0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: There should be a space after the comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@bsbernd bsbernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can enable this for passthrough_ll, passthrough_hp, etc, but can be done in a separate commit.

@bsbernd
Copy link
Collaborator

bsbernd commented Mar 2, 2023

@d-hans there is a merge conflict, can you please rebase?

@d-hans d-hans force-pushed the parallel-writes branch from f2a9c27 to 2692ea6 Compare March 3, 2023 05:52
@d-hans d-hans marked this pull request as ready for review March 3, 2023 09:02
@d-hans d-hans force-pushed the parallel-writes branch from 2692ea6 to 1750692 Compare March 3, 2023 09:08
@@ -68,6 +68,10 @@ struct fuse_file_info {
the file/directory is closed. */
unsigned int keep_cache : 1;

/** Can be filled by open/create, to allow parallel direct writes on this
* file */
unsigned int parallel_direct_writes;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: 1 is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Right now fuse kernel serializes direct writes on the
same file. This serialization is good for such FUSE
implementations which rely on the inode lock to
avoid any data inconsistency issues but it hurts badly
such FUSE implementations which have their own mechanism
of dealing with cache/data integrity and can handle
parallel direct writes on the same file.

This patch allows parallel direct writes on the same file to be
enabled with the help of a flag FOPEN_PARALLEL_DIRECT_WRITES.
FUSE implementations which want to use this feature can
set this flag during fuse init. Default behaviour remains
same i.e no parallel direct writes on the same file.

Corresponding fuse kernel patch(Merged).
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2&id=153524053bbb0d27bb2e0be36d1b46862e9ce74c
@d-hans d-hans force-pushed the parallel-writes branch from 1750692 to 0f12a86 Compare March 3, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants