LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How does one optimize the kernel? (https://www.linuxquestions.org/questions/linux-newbie-8/how-does-one-optimize-the-kernel-4175458278/)

endhx 04-16-2013 02:15 AM

How does one optimize the kernel?
 
On Ubuntu 64bit how do I optimize my kernel when compiling it? I compile/ patch my own custom kernel for various reasons.

Is adding "CFLAGS = -march=native" to my makefile all? Do I need to do something else?

What about the -pipe flag?

linosaurusroot 04-16-2013 05:22 AM

make -pipe is for affecting the compilation rather than the kernel that results from it.

You can make kernel selections that omit support for hardware and filesystem types and networking types you know you won't be using. The result is a smaller kernel using less RAM.

goumba 04-16-2013 05:56 AM

Also, in Processor features, select the appropriate type. Also, I've seen tips on the net for adjusting timing and such, but it usually results in a unstable kernel for me. Do a search on "<your processor> linux kernel optimization", and you should get a bunch of results that may work for you.

TKH 04-16-2013 09:19 AM

you might wanna disable a lot of stuff from kernel hacking menu (especially frame pointer!)
if you don't want to debug your kernel, you might want to disable all the option related to kernel debugging

more screen prints uses more memory; if you don't really need to see these messages, look for anything with "verbose" in it

endhx 04-16-2013 11:18 AM

Yes, I've actually done those things already. In this case what I'm looking to do is optimize the kernel specifically for the instruction sets supported using the -march=native line.

I'm wondering where exactly I should put that line.

I also did export KCFLAGS="-O2 -march=native -pipe" to be sure that it'd all work.

But... I just want to check.


All times are GMT -5. The time now is 01:51 AM.