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

using writeback mode need configure dm-writeback ? #62

Open
Augusto7743 opened this issue Jun 24, 2021 · 7 comments
Open

using writeback mode need configure dm-writeback ? #62

Augusto7743 opened this issue Jun 24, 2021 · 7 comments
Assignees

Comments

@Augusto7743
Copy link

I am a new Linux user.
Thanks very much in adding writeback in rapiddisk.

When using rapiddisk command line selecting writeback is need to configure dm-writeback ?
If yes setting flush data time is in dm-writeback ?

Thanks very much for reply.
Have an nice day.

@pkoutoupis
Copy link
Owner

I do not make it configurable, at least not yet. This could be a feature enhancement.

@pkoutoupis pkoutoupis self-assigned this Jun 25, 2021
@Augusto7743
Copy link
Author

Thanks very much adding writeback to rapiddisk.
You had posted rapiddisk will be a wrapper to dm-writeback.
Thus I not understand what is to configure rapiddisk or dm-writeback.
I want to create some writeback cache being :

  • one 64 MB defer write 6 minutes to root partition
  • one 256 MB defer write infinite (write when cache is full or system shutdown) for home , var and opt partitions.
  • one 64 MB defer wrte 6 minutes to another BTRFS partition where are all configurated documents, images and other folders from home.
    I has eletric protection to computer. That configuratio not create problems for me instead will help me.

Today is possible that configuration above with rapiddisk current version ?
Have an nice next week.
God bless you in your life.

@pkoutoupis
Copy link
Owner

No. It is not possible today to tune (to defer or delay) the persisting of cache data to the backing store from the rapiddisk utility. That will still need to be manually enabled via dmsetup. Again, that can be a feature enhancement where rapiddisk could potentially include the following parameters:

autocommit_blocks n (default: 64 for pmem, 65536 for ssd)
when the application writes this amount of blocks without issuing the FLUSH request, the blocks are automatically committed

autocommit_time ms (default: 1000)
autocommit time in milliseconds. The data is automatically committed if this time passes and no FLUSH request is received

https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/writecache.html

@Augusto7743
Copy link
Author

Thanks for your reply and the information link.
Writeback cache help SSD disk avoiding repeated writes of same files.

"autocommit_blocks n (default: 64 for pmem, 65536 for ssd)
when the application writes this amount of blocks without issuing the FLUSH request, the blocks are automatically committed"
That means defer flush is ignored if an application send command to flush data ?

Only trying understand if possible force flush defer write only when system shutdown or commit time.
More users need known your project.

@Augusto7743
Copy link
Author

Thanks for replying.

OS boot log reference for dm-writeback 0 (root 128 MB), 1 (home 256 MB) and 2 (opt 8 MB)

[ 7.357681] kernel: BTRFS info (device dm-0): flagging fs with big metadata feature
[ 7.365690] kernel: BTRFS info (device dm-0): has skinny extents

[ 14.253692] kernel: BTRFS info (device dm-1): flagging fs with big metadata feature
[ 14.253707] kernel: BTRFS info (device dm-1): force zlib compression, level 9
[ 14.253714] kernel: BTRFS info (device dm-1): max_inline at 0
[ 14.253717] kernel: BTRFS info (device dm-1): metadata ratio 0
[ 14.253725] kernel: BTRFS info (device dm-1): has skinny extents

[ 14.880132] kernel: BTRFS info (device dm-2): flagging fs with big metadata feature
[ 14.880145] kernel: BTRFS info (device dm-2): force zlib compression, level 9
[ 14.880151] kernel: BTRFS info (device dm-2): max_inline at 0
[ 14.880155] kernel: BTRFS info (device dm-2): metadata ratio 0
[ 14.880163] kernel: BTRFS info (device dm-2): has skinny extents

BTRFS change localization of metadata when doing fsync. Written metadata and after the superblock.

[ In BTRFS documentation ]

Can I change metadata block size without recreating the filesytem?

No, the value passed to mkfs.btrfs -n SIZE cannot be changed once the filesystem is created. A backup/restore is needed.
Note, that this will likely never be implemented because it would require major updates to the core functionality.


Is possible using dmsetup configure the created dm-wb caches ?
If have an configuration to when happen any partial written also does an metadata flush.

The documentation recommend use block size same value used in page file ( 4 KB).
Rapiddisk support 4 KB for block size ?

I have an OS installed for testing dmwrtecache. If have any command to use can be used here.

@pkoutoupis
Copy link
Owner

@Augusto7743 Are we going to use this issue number to track it and close #122?

@Augusto7743
Copy link
Author

Yes.

@pkoutoupis pkoutoupis mentioned this issue Oct 7, 2023
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