bottlerocket icon indicating copy to clipboard operation
bottlerocket copied to clipboard

kernel-parameters does not accept single-word config options, specifying them causes reboot-loops

Open james-masson opened this issue 1 year ago • 3 comments

Image I'm using: bottlerocket-aws-k8s-1.29-x86_64-v1.19.4

What I expected to happen:

I want to turn off SMT in the kernel via settings.boot.kernel-parameters This is not a key-value pair.

[settings.boot]
reboot-to-reconcile = true

[settings.boot.kernel-parameters]
"nosmt" = []
# "nosmt"

What actually happened:

The config does not seem to accept anything other than key = value, and there are many kernel config options that are only key.

The system goes into a reboot loop if I leave an empty value array.

How to reproduce the problem:

Use one or other of the options below.

[settings.boot]
reboot-to-reconcile = true

[settings.boot.kernel-parameters]
"nosmt" = []
# "nosmt"

james-masson avatar May 14 '24 13:05 james-masson

Hello @james-masson, Thanks for cutting this issue! Can you try using nosmt=force for this affect? https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html?highlight=kernel%20parameters calls out that should work:

        nosmt           [KNL,MIPS,PPC,S390,EARLY] Disable symmetric multithreading (SMT).
                        Equivalent to smt=1.

                        [KNL,X86,PPC] Disable symmetric multithreading (SMT).
                        nosmt=force: Force disable SMT, cannot be undone
                                     via the sysfs control file.

yeazelm avatar May 14 '24 15:05 yeazelm

Hi @yeazelm ,

Yes I did try that as well, it didn't work ( but the value was passed correctly to the kernel command line ). I did expect that to work, so was a bit puzzled. I also tried smt=1, which is another alternative.

I did succeed turning off SMT via sysfs, so the problem I'm reporting here is not that I can't turn SMT off, but more that Bottlerocket doesn't seem to understand the concept of the old-school single arg kernel options.

( and separately I'm cuing up a PR for the K8s reserved-cpus as per our email chain )

thanks!

james-masson avatar May 14 '24 15:05 james-masson

Thanks for the confirmation @james-masson. I agree with your evaluation, it does look like the currently logic implicitly expects a key-value pair so I was hoping to find a pair that works which is faster than figuring out how we have the single line options. We have similar issues with order: https://github.com/bottlerocket-os/bottlerocket/issues/3647 but these are slightly different things.

You might also be able to do this with a bootstrap container until we sort out single value command line arguments.

yeazelm avatar May 14 '24 18:05 yeazelm