(excuse my bad english, i translate from italian.)
bcache is a system for having devices composed of slow and large disk, with fast and small disk in front of them acting as caches.
These names are used in bcache - slow and large disk (disk intended to actually hold the data) = backing device - fast and small disk (cache) = cache device - data present only in the cache device = dirty cache - writing to the cache device and later (also much) to the backing device = writeback - cache write speed in the backing device = writeback rate
A disk data cache has always existed, it is the free RAM in the operating system, when data is read from the disk it is copied to RAM, if a data is already in RAM, it is read from RAM. When data is written to the disk, it is written to RAM and after a few moments (very short, data in RAM is volatile) to the disk as well.
........................................................ ........................................................ ........................................................
To create a bcache device you need to install the bcache-tools, for example with dnf install bcache-tools .
bcache devices are visible as /dev/bcacheN (for example /dev/bcache0), once created, they can be managed like any other disk. Warning bcache device cannot be resized.
More details are available at https://docs.kernel.org/admin-guide/bcache.html
(To delete an existing filesystem from a partition, wipefs -a /dev/... .)
Creating the backing device (and therefore the bcache device) bcache make -B /dev/md0 bcache register /dev/md0
Creating the cache device (and hooking the cache to the backing device) bcache make -C /dev/sda7 bcache register /dev/sda7
bcache attach /dev/sda7 /dev/md0
echo writeback > /sys/block/bcache0/bcache/cache_mode
bcache show
(if the status of a device is inactive, it means that it must be registered)
Name Type State Bname AttachToDev /dev/md0 1 (data) clean(running) bcache0 /dev/sda7 /dev/sda7 3 (cache) active N/A N/A
echo 0 > /sys/block/bcache0/bcache/cache/congested_write_threshold_us echo 0 > /sys/block/bcache0/bcache/cache/congested_read_threshold_us echo 600000000 > /sys/block/bcache0/bcache/sequential_cutoff echo 40 > /sys/block/bcache0/bcache/writeback_percent
Metadata Update from @glb: - Issue assigned to giusdbg - Issue tagged with: article, needs-image
+1. If you can upload your article to https://fedoramagazine.org/wp-admin/ and add a little more detail about how to create a bcache device on Fedora Linux, I think this would be a good article. Thanks!
mmm, maybe I don't fully understand the request, all the steps indicated were performed on a Fedora Linux system, perhaps a preamble is missing
bcache devices are visible as /dev/bcacheN (for example /dev/bcache0). Once created, they can be managed like any other disk. Warning bcache device cannot be resized.
Metadata Update from @giusdbg: - Assignee reset - Issue untagged with: article, needs-image
Metadata Update from @rlengland: - Issue tagged with: article, needs-image
@giusdbg The tags you removed are used by the editors to track the status, allow visibility of the issue, and provide a means of communications between authors and editors. Why did you remove the assignment to you? Do you not want to contribute this article?
You can find information on the Fedora Magazine work flow at this link
Metadata Update from @rlengland: - Issue assigned to giusdbg
@giusdbg The tags you removed are used by the editors to track the status, allow visibility of the issue, and provide a means of communications between authors and editors. Why did you remove the assignment to you? Do you not want to contribute this article? You can find information on the Fedora Magazine work flow at this link
It's not intentional, maybe looking for a button to edit what I wrote I clicked in the wrong place, sorry.
I placed the article here
https://discussion.fedoraproject.org/t/linux-bcache-with-writeback-cache-with-idiosyncrasy-circumvention-optimization-and-reduction-of-unnecessary-performance-loss/80313
but I have the feeling that I have done something wrong.
@giusdbg The location you chose for your article is the Fedora Magazine Discourse group.
In order for it to be published as a Fedora Magazine article it must be created as a post in the Fedora Magazine WordPress Instance.
You can get started by going to that link and logging in using your Fedora account. Select the + New item in the header to open the editing page and cut, paste, and edit the article there.
If you have questions about the editing process or anything else, you can leave them on this ticket as a comment and the editors will respond.
Once you have the article ready for review leave a preview link as a comment here (or just let us know and we'll assist with that).
Thanks for volunteering to write for the magazine and by all means, contact us if you have questions or need assistance.
@rlengland Thanks to you (and all of you) for your work.
Currently I'm still very uncertain about the right sequence of things and the use of tools, at 50% I try, make mistakes, try again.
I deleted the previous post and recreated it in 'see attached image', it's in draft. (does it have to be published? if published is it immediately visible to normal readers?)
If you can and want to, you should review the article - I can't get a decent alignment in the part explaining names used in bcache and on tracked performance data. - A general check (with adjustment, if it's a small thing) of the wrong or missing parts (translation blunders from Italian, SEO? TAG? etc.).
Metadata Update from @rlengland: - Custom field preview-link adjusted to https://fedoramagazine.org/?p=38109&preview=true&preview_id=38109
Hi @giusdbg
"Publishing" means that the editor will schedule the article to become visible when the edit/review steps are considered to be done. Not something for you to be concerned with except to agree that you feel the article is ready.
Becoming used to a new editing system can take some time and be difficult at first so I've taken your input on the WordPress document and performed some editing. This is primarily creating some tables and formatting what I believe are commands in "preformatted" blocks.
I've attempted to be careful but with the word editing I've done it would be good for you to read over it again and make certain I haven't mis-stated anything. We will run another editing session on this but this would be good time for a check.
Some points to consider: - The title is quite long. It's descriptive but it is going to be difficult to fit on the introductory image for the article. Can you consider simplifying it a bit? ( I was once told, about one of my titles, that you don't have to tell the entire story in the title :smile: ) - In the opening paragraph, can you give a short explanation for why someone might want to install bcache? Doesn't have to be elaborate, just the benefit someone would get using bcache and why the should read your article. Sometimes this is called a teaser to get someone to read the article). - There is a section that I have duplicated in red. The original (above the red section) was a little hard for me to understand so I've attempted to clarify it. Please take a look at this and see if I am saying what you were saying and if it improves anything. Feel free to use it, delete it, or make your own effort. - I also think it might be good for you to consider some "closing" or "summary" paragraph. It ends rather abruptly :smile:
Over all a pretty good article.
Hi @rlengland I have seen the reviews you are doing, thanks, it is much better.
I suggest for commands and long displays to use (if available) horizontally scrolling boxes (multiple lines of text wrapping are unfriendly).
The suggestions, on the title, motivations, closing, etc., are more than right. As you may have already noticed my thinking and writing style is quite methodical, I have one thing to say, a dense beginning, broad center, complete topic, end 🤣, and I tend to think that it is enough and left over to listen to me 🥺😅.
I take a few hours to think about it and adapt to the requests, tomorrow I will try to do what is requested.
Thanks again.
P.S. It seems to me that the WordPress app cannot be used on Fedora Magazine, I used it several years ago, and it was quite convenient for quick interventions and fixes.
Hi @rlengland I did, or at least tried to do, what you suggested, I also did a general check and some changes. If you agree, I will do a detailed check when you think the result is the final one.
I appreciate and find your advice and evaluations useful, so advice and evaluations, even criticisms, are welcome.
P.S. Horizontally scrolling boxes don't seem available.
@giusdbg You are correct. We don't have horizontal scrolling available in our environment. Sorry.
I've worked up a possible feature image for your article. See if it meets your approval. I was seeing the sports car as a metaphor for speed. If that makes sense.
@glb
LGTM. 🙂
@rlengland No problem.
Your image is good, beautiful, funny. It will probably be the most appreciated part of the article 🥺🤣.
Your revisions have been spot on and helpful , where I've edited is because they've highlighted my own inaccuracies and mistakes.
The subtitle is a foreign body, I'd say delete it.
As far as motivation is concerned, I don't think we can do better, I would like to avoid entering the hell of saving money.
For the conclusion I have various doubts, but currently I have no other ideas.
Hi @giusdbg "Publishing" means that the editor will schedule the article to become visible when the edit/review steps are considered to be done. Not something for you to be concerned with except to agree that you feel the article is ready. ....................
"Publishing" means that the editor will schedule the article to become visible when the edit/review steps are considered to be done. Not something for you to be concerned with except to agree that you feel the article is ready. ....................
Done, published.
@giusdbg I've done my final edit. Only a few wording changes and installing the feature image. I will plan on pushing this out to the magazine as published this Friday, 7 April.
If you find any further changes please make them before Thursday evening. (I'm in the Pacific time zone, just so you know).
Thanks for your hare work.
@rlengland There's only one thing, it's not vital but it's wrong [ to make space for more data after each 100GB portion is written. ] the first time the cache fills up by 100GB, for the following data it is emptied and filled, for example, by 1MB each time. You can see it as an overflowing container of water.
Thank you for your work, patience, support.
P.S. These days I've been very nervous, for the first day of school for the child. Will he be dressed up? will he say the right things? will the other kids be nice? am I going to be a awful parent as usual? will I be called by the principal? It doesn't matter, let's just hope that useful and fun things happen. 🥺🤣
@giusdbg I'm not completely certain I understand what you mean to say in the following paragraph. I'd rather have it correct than just publish it if you feel it is not correct or clear. Can you see what you can do to correct or clarify it, please?
Consider an example assuming there is a 1TB bcache device and a 100GB cache. When writing a 1TB file, the cache device is filled, then partially emptied to the backing device to make space for the next small blocks of data to be written to the cache, until the file is fully writed. The cache device will be stressed 10 times more than the backing device and uselessly, eventually only the last 100GB written (at any given time) are in the cache.
@giusdbg I'm not completely certain I understand what you mean to say in the following paragraph. I'd rather have it correct than just publish it if you feel it is not correct or clear. Can you see what you can do to correct or clarify it, please? Consider an example assuming there is a 1TB bcache device and a 100GB cache. When writing a 1TB file, the cache device is filled, then partially emptied to the backing device to make space for the next small blocks of data to be written to the cache, until the file is fully writed. The cache device will be stressed 10 times more than the backing device and uselessly, eventually only the last 100GB written (at any given time) are in the cache.
I'm describing one type of possible cache operation. Let's take a water pipe, a bucket and a swimming pool as an example.
Little by little the bucket is filled. At this point the bucket is not emptied completely into the pool, just a little, refilled, and emptied a little again, and so on until all the water has been transferred.
Complete emptying of the bucket takes too long (and in the meantime you have to turn off the water tap). That's unacceptable, the only alternative is to skip the bucket and take the water straight to the pool.
I have already revised that paragraph, if it is acceptable to you too, no further revisions are needed.
If you find that the paragraph is incorrect, I try to eliminate the parts of the paragraph that are accessory.
If the concept is difficult to explain in writing, perhaps an illustration would be beneficial? See Working with Btrfs – General Concepts for a good example where someone added a few small illustrations to their article to help explain a complex topic.
If you decide to use an example image like the bucket and the pool: - The pool is filled through a small funnel (slowly) - The bucket is emptied from the bottom (old things)
P.S. A bit shortened and simplified:
Consider an example assuming there is a 1TB bcache device and a 100GB cache. When writing a 1TB file, the cache device is filled, then partially emptied to the backing device, and next refilled, until the file is fully writed. The cache device will be stressed 10 times more than the backing device and uselessly, eventually only the last 100GB written (at any given time) are in the cache.
Sorry I disappeared but this Easter weekend was filled with choir obligations and I just couldn't get back to this article.
I've used your suggestions and did anther rewrite on that one paragraph. If you approve, I think it is ready to go.
Once more I ask you give it your blessing (or corrections). My apologies for "disappearing". :rabbit:
There's no need to apologize, everyone has commitments and priorities, especially during the holidays.
[The cache device will be stressed 10 times more than the support device, --without any useful result--]. The -- ... -- part would be better left.
A cache system is by its very nature a short blanket, you cover one thing and you discover another. In the (extreme) example given, stressing the cache is useless and also harmful (it slows down the functioning of the cache).
A cache system is made up of simple things, (but unfortunately) whose interactions are complex, variable and unstable. The parts of the article dealing with interactions have already been reduced, summarized, almost as if they were just an introduction.
For me, with or without the suggested fix, the article is publishable.
@giusdbg The article is scheduled for tomorrow, 14 April
@giusdbg Oops, Make that 17 April. Conflict arose with anther article.
Metadata Update from @rlengland: - Custom field editor adjusted to rlengland - Custom field image-editor adjusted to rlengland - Custom field publish adjusted to 2023-04-17 - Issue untagged with: needs-image
@rlengland Thank to you.
No problem, only a few more days of anxiety before knowing if the child will have a good first day of school.
Hi. I receive emails asking me to approve comments. Are these things that do not concern me? However, I tried to do it on a comment of my article, and the comment remains to be approved.
Unfortunately, there is a problem with the permissions that is preventing authors from approving comments. I've been meaning to look into it, but I haven't yet.
Issue status updated to: Closed (was: Open) Issue close_status updated to: scheduled