-
Notifications
You must be signed in to change notification settings - Fork 47
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
kernel cmdline parameters for bcache devices #20
base: master
Are you sure you want to change the base?
Conversation
Just a quick remark: the numbering in sysfs isn't stable. |
(I think the above limit is 4k: COMMAND_LINE_SIZE in https://www.kernel.org/doc/Documentation/kernel-parameters.txt) |
Thanks for your feedback. I won't mind doing another attempt, but it would be nice if that would be the last one :-) Suppose we introduce a file /etc/bcache.conf which contains the parameters. That file is copied in the initramfs, but is also used afterwards from it's normal rootfs position. That would work, but it's rather static. Everytime you'd like to try a different setting you need to rebuild the initramfs. I wouldn't be in favour of that. We could do a combination of both: have a /etc/bcache.conf file and parsing of kernel cmdline to overrule /etc/bcache.conf. That's more complex however: parsing both, store in memory, apply. I would be OK with that, if it would contribute to the final attempt. I heard about limitations on the kernel cmdline size when creating the dracut module. Can't find the details on the web though, but the idea was that one can add additional params in the dracut config to get around these limitations. I'll do some testing to find out. |
Dit some testing, I passed a 3589 bytes long cmdline in grub, according to the kernel the cmdline was "only" 2040 bytes long: [root@home07 ~]# grep fake=0123 /etc/grub2.cfg so ~ 2k in size. Not a serious limitation. But, when entering the cmdline arguments during boot by hand, it may be convenient to have shortcuts. And entering the cset uid won't be an option too if entered by hand. The (optional) label would be an option though. |
How about something that applies to all devices? |
That would be really easy to create, and would do for me (I only want to experiment with bootup times) but may not suffice in general. Would applying it to all devices be OK with you? |
Maybe later a combined /etc/bcache.conf + cmdline version, but depending on the new bcache Kent is working on that may not be needed in the end. |
Applying to all disks, and doing the minimum necessary to get a reliable feature is fine by me. As far as forward compat: If someone wants to make things more granular, the udev helper could give priority to per-disk settings if/when they are implemented. That helper can also be the place where conffile support is added. |
|
||
install: make-bcache probe-bcache bcache-super-show | ||
install: make-bcache probe-bcache bcache-super-show bcache-register bcache-params | ||
$(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/ | ||
$(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to install bcache-params in UDEVLIBDIR.
Did some testing on Fedora, seems to work OK:
|
Gabriel, could you respond please? |
My apologies. I didn't have enough time to review and it slipped my mind. |
A (polite) ping... |
For experimenting (or production) it may be useful to set bcache parameters in an early stage during boot, for example to tune the boot performance when the root fs is on a bcache device. The best moment is right before the root fs is actually mounted, which means it may need to be done in the initramfs.
The bcache kernel drivers does not support passing kernel cmdline parameters to it. This program can be excuted from udev rules to take care of it by changing bcache parameters using the /sys interface right after a bcache device is brought up. This works both in the initramfs and later.
It recognizes parameters like these:
bcache.0=sco:0,crdthr:0,cwrthr:0
This means:
Because of kernel cmdline limitations all parameters are based on a short alias, which represents the long /sys filename. Currently 3 parameters are supported that need to be set prior to root fs mount to directly impact performance in the early boot stage.