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

Slightly cleaner kernel for generic VMs #5

Closed
wants to merge 11 commits into from
Closed

Slightly cleaner kernel for generic VMs #5

wants to merge 11 commits into from

Conversation

ToeiRei
Copy link

@ToeiRei ToeiRei commented Jan 1, 2021

This is a 'port' of my debian-vm config which should work on HyperV, Proxmox, Virtualbox - I left a bunch of network card drivers in there as people sometimes pass through those for firewalling stuff or increasing traffic. Same for VGA cards due to plex encoding

config/x86/kernel-config Outdated Show resolved Hide resolved
config/x86/kernel-config Outdated Show resolved Hide resolved
config/x86/kernel-config Outdated Show resolved Hide resolved
@olljanat
Copy link
Member

olljanat commented Jan 3, 2021

Can you include those small corrections, then try build kernel like and update modules files based build log?

@ToeiRei
Copy link
Author

ToeiRei commented Jan 3, 2021

I have yet had no time to play with the build system.

@olljanat
Copy link
Member

olljanat commented Jan 3, 2021

Just build with make command like it is decribed on readme.

@ToeiRei
Copy link
Author

ToeiRei commented Jan 13, 2021

The build system seems to have an inconsistent modules list. I've purged it already 7 times...

@olljanat
Copy link
Member

It might be that those files need to be sorted. Successfully passed build after including https://github.com/olljanat/os-kernel/commit/5f07c70e3bd3a7d8bdb7a5368bc04e5cb5277c20 and using build command:

KERNEL_TAG=5.10.7 OVERRIDE_KERNEL_ARCH=x86 make release

But on build result those files looks huge compared to https://github.com/burmilla/os-kernel/releases/tag/v5.10.1-burmilla

$ ls -lh dist/kernel/
total 1.5G
-rw-r--r-- 1 olli olli  16M Jan 14 23:03 build-linux-5.10.7-burmilla-x86.tar.gz
-rw-r--r-- 1 olli olli 152K Jan 14 23:03 config
-rw-r--r-- 1 olli olli 565M Jan 14 23:03 extra-linux-5.10.7-burmilla-x86.tar.gz
-rw-r--r-- 1 olli olli 181M Jan 14 20:02 linux-5.10.7-burmilla-x86-src.tgz
-rw-r--r-- 1 olli olli 693M Jan 14 23:00 linux-5.10.7-burmilla-x86.tar.gz
-rw-r--r-- 1 olli olli  31K Jan 14 22:55 modules-extra.list
-rw-r--r-- 1 olli olli  32K Jan 14 22:54 modules-main.list

@ToeiRei
Copy link
Author

ToeiRei commented Jan 15, 2021

We have more network cards supported as you find a lot of weird stuff in home labs. But if you want me to, I can strip it down more by throwing out some more obsolete cards (I still have drivers for a 3C509 in there)

@olljanat
Copy link
Member

But if you want me to, I can strip it down more by throwing out some more obsolete cards (I still have drivers for a 3C509 in there)

I mean that after your changes kernel package is ten times bigger than before these changes.

Comparison of compressed files:

$ ls -lh
total 740M
-rw-r--r-- 1 olli olli  48M Dec 16 19:29 linux-5.10.1-burmilla-x86.tar.gz
-rw-r--r-- 1 olli olli 693M Jan 14 23:00 linux-5.10.7-burmilla-x86.tar.gz

Comparison of non-compressed files:

5.10.1$ du -sh
161M	.

5.10.7$ du -sh
2.3G	.

@ToeiRei
Copy link
Author

ToeiRei commented Jan 16, 2021

I suspect my mistake: I'm used to embed firmware. My bad.

@@ -423,33 +419,34 @@ CONFIG_X86_DIRECT_GBPAGES=y
CONFIG_NUMA=y
CONFIG_AMD_NUMA=y
CONFIG_X86_64_ACPI_NUMA=y
# CONFIG_NUMA_EMU is not set
CONFIG_NUMA_EMU=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about based on https://cateee.net/lkddb/web-lkddb/NUMA_EMU.html that does this actually make sense?

CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
CONFIG_MTRR_SANITIZER=y
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When reading this I'm not sure if we really want disable this one https://github.com/tomreyn/linux_mtrr_size_fix

@@ -504,7 +502,7 @@ CONFIG_HIBERNATION_SNAPSHOT_DEV=y
CONFIG_PM_STD_PARTITION=""
CONFIG_PM_SLEEP=y
CONFIG_PM_SLEEP_SMP=y
# CONFIG_PM_AUTOSLEEP is not set
CONFIG_PM_AUTOSLEEP=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite sure that we don't need support sleep for BurmillaOS so probably it makes sense to leave this untouched
and also set CONFIG_PM_SLEEP and CONFIG_PM_SLEEP_SMP to "n"
https://github.com/torvalds/linux/blob/master/kernel/power/Kconfig#L117-L145

@@ -982,41 +1002,36 @@ CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
CONFIG_ARCH_WANTS_THP_SWAP=y
CONFIG_THP_SWAP=y
CONFIG_CLEANCACHE=y
# CONFIG_CLEANCACHE is not set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we really want disable this one https://github.com/torvalds/linux/blob/master/mm/Kconfig#L448-L468

@ToeiRei
Copy link
Author

ToeiRei commented Jan 19, 2021

It's what Debian does and I assume those guys aren't stupid.

@olljanat
Copy link
Member

It's what Debian does and I assume those guys aren't stupid.

Yea but Debian is generic purpose OS for everything from low power laptops to high power servers which why they are forced to do compromises. BurmillaOS instead of is purpose build server OS which kernel parameters tuning Rancher Labs guys have used a lot of time which why IMO we should not change any setting unless we know that those make sense.

However I cherry-picked some changes from this PR to #6 now and will start by testing those.

@ToeiRei
Copy link
Author

ToeiRei commented Jan 19, 2021

Keep in mind what the average user at home calls a server - this can be anything from an ancient x-series up to some Intel NUC - that's why I picked some of those options.

@olljanat
Copy link
Member

Looks that we are not able to agree best possible kernel parameters here and most probably it does not even matter as it looks to be possible share kernel with k3OS (look: burmilla/os#5 (comment) ) so future development should be done on https://github.com/rancher/k3os-kernel

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

Successfully merging this pull request may close these issues.

2 participants