LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Compiling kernel (https://www.linuxquestions.org/questions/linux-general-1/compiling-kernel-8926/)

harrygraham 11-19-2001 01:34 PM

Compiling kernel
 
Greetings all.

I am an old Newbie - can't seem to graduate to the next level. Anyway, I managed to install Mandrake 8.1 on my Pentium II and it works a heck of a lot better than 7.2. Now I'm greedy for optimizing my machine for best performance on the Internet.

First question: Will making the PPP run right off the kernel, rather than as a module improve performance, or am I taking a step backwards by so doing?

Now to the real problem.

So I tried to use the new nifty program to check off all the unused modules and kernel support for stuff that I'll never use on this machine, thinking that it will reduce the size of the kernel. (Am I right?) Took me two hours to read through all the techno mumbo-jumbo, but I got through it! But what's this about make clean and make dep etc? I tried it and it just sat there with the root cursor blinking for and hour. Is it supposed to take this long? Am I leaving out an important step? I've never 'made' a file in my life, and would like to try.

Anyway, my quest for super-duper performance might seem a little weird for someone who only has a 233Mhz, but what the heck, I'm learning for the future! Any help gratefully accepted.



Harry Liston

webtoe 11-19-2001 03:04 PM

you'd be amazed at how well a pII 233 can fly with linux on it (linux gives you computer wings :D )



anyway. here;s how to compile the kernel. in one easy step.



at the root prompt (in /usr/src/linux) type the following in



Code:


make dep; make clean; make bzImage; make modules; make modules_install



this will do it in one fell swoop (as long as no errors show their ugly heads). the bzImage is a compressed kernel and so should take up less space (a be generally more wizzy).



haveing the ppp bits compiled in or as modules won't really affect the speed of your internet connection. but, having it as a module will make the kernel smaller (and therefore faster) and will mandy should only load the necessary modules when they are needed.



to make ppp faster do the following.



go into /etc/ppp and edit the 'options' file (you'll need to be root)



put in the following lines



Code:


mtu 516

mru 516



apparently you can fiddle with these to get faster connections but these numbers are pretty generic.



basically what these do is tell ppp to only send packets the size of 516 bytes and only recieve packets the size of 516 bytes. this makes your connection more efficient because if their is an error in recieving or sending (this happens all the time) your computer only has to send/recieve a smaller file rather than download an entire 1500 byte packet all over again. also on 56k modems it is easier on the modem to send/recieve loads of little packets over a period of time rather than struggle with one whopping huge one.



this optimisations can also be applied to windows btw but it is a damn site more difficult.



both windows and linux use a default mtu/mru of 1500. this is okay for lan/ethernet/cable/dsl



Alex

P.S. i assume in the kernel config you selected your processor and enabled mtrr and disabled maths co-processor emulation (they're all in the first menu) . you also would want to remove the bloody huge memory usagy option as well. you will never use more than a gig of ram in a 233

isajera 11-19-2001 03:45 PM

weird... never heard of the mtu or the mru before... and i spent almost all of last week pouring through every ppp document, thread, and how-to i could find....

anyway, as far as the ppp in the kernel goes, no, it won't really speed things up considerably if you compile it into the kernel instead of as a module. the only real difference would be the time it takes to insert or remove the module.

webtoe 11-19-2001 04:44 PM

well its in the man page so i don;t know how you missed it :p



Quote:


mru



Set the MRU [Maximum Receive Unit] value to n. Pppd

will ask the peer to send packets of no more than n bytes. The minimum MRU value is 128. The default MRU value is 1500. A value of

296 is recommended for slow links (40 bytes for TCP/IP header + 256

bytes of data). (Note that for IPv6 MRU must be at least 1280)



mtu



Set the MTU [Maximum Transmit Unit] value to n. Unless the

peer requests a smaller value via MRU negotiation, pppd will request that the kernel networking code send data packets of no more

than n bytes through the PPP network interface. (Note that for

IPv6 MTU must be at least 1280)



Alex

harrygraham 11-19-2001 10:43 PM

Thanks
 
Many thanks for the info on the subject. I'll let you know in a few days how I fare with the new kernel.

Harry

harrygraham 11-26-2001 08:06 PM

Well, I finally got around to trying my home-grown kernel, and it does indeed improve performance. The Gimp is working about three times as fast at opening large image files, and the whole computer seems more robust. Unfortunately, the ppp doesn't work and the configuration is all messed up. (yes, I'm using M$ to send this message...) But this doesn't bother me. I have proved to myself that compling the kernel works. So with a little more care, I'll get everything working just great! I really needed to do another install anyways.


Thanks

DavidPhillips 11-26-2001 09:09 PM

You may on ocassion find a site that will not work with a very low mtu or mru, The internet standard being 576. But play around with the numbers.

You should not have to reload the system to get ppp working, Try working with it and see what the log files are saying, play around with minicom and see if it will work.

to see if it is supported by your kernel run pppd in an xterm and you should get a bunch of mumbo jumbo like this

[root@Alpha root]# pppd
~ÿ}#À!}!}!} }8}"}&} } } } }#}$À#}%}&«|uÖ}'}"}(}"YT~~ÿ}#À!}!}!} }8}"}&} } } } }#}$À#}%}&«|uÖ}'}"}(}"YT~~ÿ}#À!}!}!} }8}"}&} } } } }

follow this howto to get it checked out

http://axion.physics.ubc.ca/ppp-linux.html

SlCKB0Y 11-27-2001 12:10 AM

Umm....dont you think the person might like to *configure* their kernel??


I generally like to do a
make mrproper
then ...
make config OR make menuconfig OR make xconfig, or if you have an old .config file in /usr/src/linux, then do a make oldconfig and just answer the options available in the new kernel keeping all the old options the same. if you need to keep your old .config, then dont do the above "make mrproper" as it will clean it out.

THEN do...

Quote:

make dep; make clean; make bzImage; make modules; make modules_install

isajera 11-28-2001 11:11 PM

Quote:

Originally posted by webtoe
well its in the man page so i don;t know how you missed it :p




lol...:D ...ok... YOU melt your brain pouring over ppp codes and obscure modem commands for a few days and see exactly how much the letters "mtu" mean to you afterwards.

just a quick question if you don't have ppp working yet... what kernel version are you upgrading to and from?

harrygraham 11-28-2001 11:48 PM

The kernel I'm trying to compile is the same one that came with the Linux Mandrake 8.1 distro -

2.4.8-26mdk

But something is terribly wrong now. I'm not sure if it's the Bastille firewall or what, but I can't seem to copy the .config file anymore. It says there is not enough room on the disk. How can this be? Is it just a phantom file that is soft-linked somewhere to the real file? Very frustrating!

harrygraham 12-01-2001 10:32 PM

I think maybe a less radical approach to kernel compiling would solve a few of my problems. It's too difficult for me to reinstall all the features after going through this little exercise of optimizing the kernel. I found an interesting article on the subject which (I think) puts things in perspective.


http://www.linuxgazette.com/issue37/martinez.html


Thanks anyways. Maybe I'll try it again whenever I have a few extra bags of Cheetos on hand.


Harry

DavidPhillips 12-05-2001 09:05 PM

If you rebuild the kernel and suddenly everything is gone bad it sounds to me like you are not making the new kernel modules and maping to them.


I don't know, but I have several kernels and several module folders to go with them.

harrygraham 12-06-2001 08:49 AM

Mapping? What's that?
 
I did make modules and make modules_install. Is that the same thing as mapping the modules to the kernel?

I believe the kernel wasn't made right somehow, because when it's going through the final stages it lists about ten modules that it can't find. So maybe you're right.

Harry

webtoe 12-06-2001 11:34 AM

i have a feeling that that might be settings in /etc/modules.conf (or conf.modules) that is trying to load modules that no longer exist (ones that you thought you didn't need anymore). Unfortunatly, mandrake might still try to load them (it won't know that you removed the modules). If everything else works apart from these messages then it doesn't really matter.

You have three options:
1.)recompile with these missing modules in (not really a solution, just taking you back to the begining of your problem).
2.)edit the appropriate file to stop mandrake attempting to load the modules at start up
3.)ignoe them, it probably won't make much of a difference.

If you notice anything weird then tell us.

Alex

finegan 12-06-2001 11:36 AM

Mandrake usually comes with Alsa installed, a big fat pile of modules that usually resides Outside of the kernel source directory. They do, or did with 8.0 at least, also keep pcmcia-cs there too. The downshot to this is after you have re-compiled youre kernel, you have to recompile Alsa (and pcmcia if this is a laptop) to keep init from going wonko bazoo. I doinked up something the other week on my laptop and had to go through all 3 steps to finally make init happy.
Quote:

I believe the kernel wasn't made right somehow, because when it's going through the final stages it lists about ten modules that it can't find. So maybe you're right
You're probably refering to init, which hasn't been updated due to the kernel compile, so its trying to insmod things that aren't there anymore.

-Cheers,

Finegan


All times are GMT -5. The time now is 10:42 PM.