I've never modified the kernel, at most recompiled back-in-the-day before most things became dynamically loadable. There's a small number of settings that need tuning for various purposes (e.g. database server). The most challenging one was getting server motherboard BIOS/CMOS settings in sync with the kernel to get NUMA memory on multi-processor machines to behave consistently.