forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 7
Redfs ubuntu noble writethrough split #182
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
Closed
hbirth
wants to merge
2
commits into
redfs-ubuntu-noble-6.8.0-58.60
from
redfs-ubuntu-noble-writethrough-split
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1464,6 +1464,50 @@ static void fuse_dio_unlock(struct kiocb *iocb, bool exclusive) | |
| } | ||
| } | ||
|
|
||
|
|
||
| /* | ||
| * With writeback caching the request size seen by the server depends on | ||
| * how many contiguous dirty pages the flusher finds, which is bounded by | ||
| * dirty throttling: with BDI_CAP_STRICTLIMIT the dirty window can degrade | ||
| * to a single page under streaming writes, turning large application | ||
| * writes into page-sized requests. | ||
| * | ||
| * Writes that already match the server's preferred alignment gain | ||
| * nothing from accumulating in the page cache, so send them through | ||
| * fuse_perform_write() instead, which packs requests up to max_write. | ||
| * They create no dirty pages, hence no DLM write lock needs to be cached | ||
| * for them. Unaligned writes keep using the writeback cache, where they | ||
| * can merge with neighbouring data. | ||
| */ | ||
| static bool fuse_use_writeback_cache(struct fuse_conn *fc, struct kiocb *iocb, | ||
| struct iov_iter *from) | ||
| { | ||
| size_t count = iov_iter_count(from); | ||
| u64 align; | ||
| bool ret; | ||
|
|
||
| if (!fc->big_writes) { | ||
| printk("%s: wbc=1 no big_writes pos=%lld count=%zu\n", | ||
| __func__, iocb->ki_pos, count); | ||
| return true; | ||
| } | ||
|
|
||
| /* these rely on the semantics of their current paths */ | ||
| if (iocb->ki_flags & (IOCB_DIRECT | IOCB_APPEND | IOCB_NOWAIT)) { | ||
| printk("%s: wbc=1 ki_flags=0x%x pos=%lld count=%zu\n", | ||
| __func__, iocb->ki_flags, iocb->ki_pos, count); | ||
| return true; | ||
| } | ||
|
|
||
| align = fc->alignment_pages ? | ||
| (u64)fc->alignment_pages << PAGE_SHIFT : PAGE_SIZE; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why enforcing alignment on page size if |
||
|
|
||
| ret = !IS_ALIGNED(iocb->ki_pos | (u64)count, align); | ||
|
hbirth marked this conversation as resolved.
|
||
| printk("%s: wbc=%d pos=%lld count=%zu align=%llu alignment_pages=%u\n", | ||
| __func__, ret, iocb->ki_pos, count, align, fc->alignment_pages); | ||
| return ret; | ||
| } | ||
|
|
||
| static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from) | ||
| { | ||
| struct file *file = iocb->ki_filp; | ||
|
|
@@ -1486,6 +1530,9 @@ static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from) | |
| goto writethrough; | ||
| } | ||
|
|
||
| if (!fuse_use_writeback_cache(fc, iocb, from)) | ||
| goto writethrough; | ||
|
|
||
| /* if we have dlm support acquire the lock for the area | ||
| * we are writing into */ | ||
| if (fc->dlm) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.