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

Can't configure hugepages kernel args, image factory changes order in kernel command line. #154

Open
Tracked by #9249
kdish opened this issue Oct 15, 2024 · 6 comments

Comments

@kdish
Copy link

kdish commented Oct 15, 2024

Trying to generate a bare metal image of talos 1.8.1 with the following extra kernel args
hugepagesz=1G hugepages=32 hugepagesz=2M hugepages=1024

All arguments entered are present in the generated kernel command line (and image), but they are not in the same order. (The hugepage settings require that the size and count are in sequence).

The resulting kernel command line from image factory looks like this:
talos.platform=metal console=tty0 init_on_alloc=1 slab_nomerge pti=on consoleblank=0 nvme_core.io_timeout=4294967295 printk.devkmsg=on ima_template=ima-ng ima_appraise=fix ima_hash=sha512 hugepagesz=1G hugepagesz=2M hugepages=32 hugepages=1024

This results in hugepages being disabled at boot.

@smira
Copy link
Member

smira commented Oct 15, 2024

Yes, this is a bug, but partially also the way Talos handles kernel command line, so fixing it won't be easy, but we should fix that.

@kdish
Copy link
Author

kdish commented Oct 16, 2024

Thanks for accepting the report! Is there any possible workaround i could try? I'm trying to run an application that needs these hugepage settings and I would prefer to do it with talos....

@kdish
Copy link
Author

kdish commented Oct 16, 2024

For anyone else running into this issue, I managed to get hugepages working by mounting the /boot partition from the generated image and editing the kernel command line in grub/grub.cfg

After booting on my modified image I get:
$ kubectl describe nodes | grep -A 8 Allocatable | grep huge
hugepages-1Gi: 32Gi
hugepages-2Mi: 2Gi

Which is what I want...
Please let me know if there are any fundamental problems with this approach, otherwise I will go with this until the bug is fixed.

@smira
Copy link
Member

smira commented Oct 16, 2024

Yes, this is the only workaround unless there's any other way to configure hugepages.

@smira
Copy link
Member

smira commented Oct 16, 2024

https://docs.kernel.org/admin-guide/mm/hugetlbpage.html there seems to be multiple ways to configure hugepages, so it might be that you can get around by using sysfs and machine configuration.

@kdish
Copy link
Author

kdish commented Oct 16, 2024

Thanks. I'll look into the docs.

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

No branches or pull requests

2 participants