public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kernel optimization
@ 2005-07-22 18:55 christos gentsis
  2005-07-22 19:52 ` David Lang
  2005-07-22 20:14 ` Adrian Bunk
  0 siblings, 2 replies; 14+ messages in thread
From: christos gentsis @ 2005-07-22 18:55 UTC (permalink / raw)
  To: linux-kernel

hello

i would like to ask if it possible to change the optimization of the 
kernel from -O2 to -O3 :D, how can i do that? if i change it to the top 
level Makefile does it change to all the Makefiles?

And let's say that i change it... does this generate any problems with 
the space that the kernel will take? (the kernel will be much larger)

Thanks
Chris


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <200507231849.j6NInMPO003728@laptop11.inf.utfsm.cl>]
* RE: kernel optimization
@ 2005-07-27  3:53 Al Boldi
  2005-07-27  4:20 ` Lee Revell
  0 siblings, 1 reply; 14+ messages in thread
From: Al Boldi @ 2005-07-27  3:53 UTC (permalink / raw)
  To: 'Adrian Bunk'; +Cc: 'Linux kernel', 'Horst von Brand'

Adrian Bunk wrote: {
On Tue, Jul 26, 2005 at 08:22:59AM +0300, Al Boldi wrote:
> Dr. Horst H. von Brand wrote: {
> Al Boldi <a1426z@gawab.com> wrote:
> >  Adrian Bunk wrote: {
> > On Fri, Jul 22, 2005 at 07:55:48PM +0100, christos gentsis wrote:
> > > i would like to ask if it possible to change the optimization of the 
> > > kernel from -O2 to -O3 :D, how can i do that? if i change it to the 
> > > top level Makefile does it change to all the Makefiles?
> > And since it's larger, it's also slower.
> > }
> 
> > It's faster but it's flawed.  Root-NFS boot failed!
> 
> How do you know that it is faster if it is busted?
> }
> 
> The -O3 compile produces a faster kernel, which seems to work perfectly,
> albeit the Root-NFS boot flaw!

How did you measure that you that your -O3 kernel isn't slower?
}

Gettimeofday loops using gcc-3.2.2 on 2.4.31 and 2.6.12.

Also, 2.4 is faster than 2.6!

Try this:

#define __USE_GNU
#include <stdio.h>
#include <sys/time.h>

unsigned long elapsed(int start) {

	static struct timeval s,e;

	if (start) return gettimeofday(&s, NULL);

	gettimeofday(&e, NULL);

	return ((e.tv_sec - s.tv_sec) * 1000 + (e.tv_usec - s.tv_usec) /
1000);

}

int main(int argc, char *argv[]) {

	int i;
	
	elapsed(1);
	for (i = 0; elapsed(0) < 100; i++) {
		int ret = i;

		if (ret > i)
			break;
		else if (ret < 0) {
			perror("not here");
			break;
		}
		ret++;
	}

	printf("Elapsed: %lu in %lums %lu/ms",i,elapsed(0),i/elapsed(0));

	int tmo=i;

	elapsed(1);
	for (i = 0; i < 100*tmo ; i++) {
		int ret = i;

		if (ret > i)
			break;
		else if (ret < 0) {
			perror("not here");
			break;
		}
		ret++;
	}

	printf(" - %lu/ms",i/elapsed(0));

	elapsed(1);
	for (i = 0; i < 100*tmo ; i++);

	printf(" - %lu/ms\n",i/elapsed(0));

	return 0;
}

--
Al


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-07-27  4:20 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-22 18:55 kernel optimization christos gentsis
2005-07-22 19:52 ` David Lang
2005-07-22 20:15   ` Adrian Bunk
2005-07-22 20:14 ` Adrian Bunk
2005-07-22 21:11   ` christos gentsis
2005-07-23 14:34     ` Simon Strandman
2005-07-23  5:35   ` Al Boldi
2005-07-23  6:30   ` cutaway
2005-07-23 19:50     ` Alan Cox
2005-07-23 22:03       ` cutaway
     [not found] <200507231849.j6NInMPO003728@laptop11.inf.utfsm.cl>
2005-07-26  5:22 ` Al Boldi
2005-07-26  9:22   ` Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2005-07-27  3:53 Al Boldi
2005-07-27  4:20 ` Lee Revell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox