Skip to content
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

Disable writeback cache for rapiddisk RAM drives #147

Closed
pkoutoupis opened this issue Jan 4, 2023 · 4 comments
Closed

Disable writeback cache for rapiddisk RAM drives #147

pkoutoupis opened this issue Jan 4, 2023 · 4 comments
Assignees

Comments

@pkoutoupis
Copy link
Owner

diff --git a/module/rapiddisk.c b/module/rapiddisk.c
index 735aeda..d570d00 100644
--- a/module/rapiddisk.c
+++ b/module/rapiddisk.c
@@ -819,9 +819,9 @@ static int attach_device(unsigned long num, unsigned long long size)
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
-       blk_queue_write_cache(disk->queue, true, false);
+       blk_queue_write_cache(disk->queue, false, false);
 #else
-       blk_queue_write_cache(rdsk->rdsk_queue, true, false);
+       blk_queue_write_cache(rdsk->rdsk_queue, false, false);
 #endif
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
        blk_queue_flush(rdsk->rdsk_queue, REQ_FLUSH);

Avoid double writing data in memory.

@pkoutoupis pkoutoupis self-assigned this Jan 4, 2023
pkoutoupis added a commit that referenced this issue Feb 4, 2023
Disable unnecessary writeback cache in rapiddisk module (#147)
@pkoutoupis
Copy link
Owner Author

This was merged in #151

@Augusto7743
Copy link

@pkoutoupis

All good with you ?

That PR disable creating wb caches or only remove code doing double writing data ?

@pkoutoupis
Copy link
Owner Author

@Augusto7743 Hello. All is good. You?
The second scenario. It is just a one line change in the RAM drive module that does not affect the dm_writecache support. So, no worries there.

@Augusto7743
Copy link

current master version working without issues in kernel 6.2.6.
Have an nice week for you and the users too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants