2005-02-08 03:02:44

by Matthew Wilcox

[permalink] [raw]
Subject: [PATCH] Makefiles are not built using a Fortran compiler


David Holland pointed out that Make has a lot of implicit suffix rules
built in and you can disable them by setting ".SUFFIXES:". As an
example, checking the debugging information shows we no longer try to
compile anything from a '.f' suffix. This turns out to be good for a 15%
speedup on a build with nothing to do; down from 29.1 seconds to 24.7
seconds on my K6.

Signed-off-by: Matthew Wilcox <[email protected]>

Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.6/Makefile,v
retrieving revision 1.338
diff -u -p -r1.338 Makefile
--- Makefile 6 Feb 2005 06:43:49 -0000 1.338
+++ Makefile 8 Feb 2005 02:39:28 -0000
@@ -4,6 +4,8 @@ SUBLEVEL = 11
EXTRAVERSION =-rc3-pa3
NAME=Woozy Numbat

+.SUFFIXES:
+
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README
Index: scripts/Makefile.build
===================================================================
RCS file: /var/cvs/linux-2.6/scripts/Makefile.build,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile.build
--- scripts/Makefile.build 12 Jan 2005 20:18:19 -0000 1.9
+++ scripts/Makefile.build 8 Feb 2005 02:39:28 -0000
@@ -4,6 +4,8 @@

src := $(obj)

+.SUFFIXES:
+
.PHONY: __build
__build:


--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain


2005-02-08 12:24:03

by Roman Zippel

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

Hi,

On Tue, 8 Feb 2005, Matthew Wilcox wrote:

>
> David Holland pointed out that Make has a lot of implicit suffix rules
> built in and you can disable them by setting ".SUFFIXES:". As an
> example, checking the debugging information shows we no longer try to
> compile anything from a '.f' suffix. This turns out to be good for a 15%
> speedup on a build with nothing to do; down from 29.1 seconds to 24.7
> seconds on my K6.

Enabling the following in the Makefile should have the same effect:

# For maximum performance (+ possibly random breakage, uncomment
# the following)

#MAKEFLAGS += -rR

bye, Roman

2005-02-08 15:44:29

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

On Tue, Feb 08, 2005 at 01:23:48PM +0100, Roman Zippel wrote:
> Enabling the following in the Makefile should have the same effect:
>
> # For maximum performance (+ possibly random breakage, uncomment
> # the following)
>
> #MAKEFLAGS += -rR

This reduces the debug output even further (and size of debug output is
strongly correlated with time taken to do a null build):

-rw-r--r-- 1 willy willy 65582214 2005-02-07 21:13 vanilla.debug
-rw-r--r-- 1 willy willy 51413770 2005-02-07 22:17 nosuffixes.debug
-rw-r--r-- 1 willy willy 37245484 2005-02-08 09:56 maxperf.debug

Seems like it gets rid of the RCS and SCCS rules -- certainly a big
improvement, and I'm not sure anyone really uses those rules. Can we
perhaps uncomment this line at the beginning of 2.6.12 and see if anyone
complains? This should reduce make overhead by 30-40% which is really
worth doing.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain

2005-02-08 17:05:40

by Ryan Anderson

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

On Tue, Feb 08, 2005 at 03:44:17PM +0000, Matthew Wilcox wrote:
> On Tue, Feb 08, 2005 at 01:23:48PM +0100, Roman Zippel wrote:
> > Enabling the following in the Makefile should have the same effect:
> >
> > # For maximum performance (+ possibly random breakage, uncomment
> > # the following)
> >
> > #MAKEFLAGS += -rR
>
> This reduces the debug output even further (and size of debug output is
> strongly correlated with time taken to do a null build):
>
> -rw-r--r-- 1 willy willy 65582214 2005-02-07 21:13 vanilla.debug
> -rw-r--r-- 1 willy willy 51413770 2005-02-07 22:17 nosuffixes.debug
> -rw-r--r-- 1 willy willy 37245484 2005-02-08 09:56 maxperf.debug
>
> Seems like it gets rid of the RCS and SCCS rules -- certainly a big
> improvement, and I'm not sure anyone really uses those rules. Can we
> perhaps uncomment this line at the beginning of 2.6.12 and see if anyone
> complains? This should reduce make overhead by 30-40% which is really
> worth doing.

The BitKeeper users sometimes make use of the SCCS rules.

BK installs itself in such a way as to provide the SCCS commands, and
Make will update things if you forget to do a bk -r get -Sq after a
pull.

>From a totally clean tree, this doesn't work (I forget why, offhand, but
I think it's something to do with the *config targets), but it is
helpful at times from partially clean trees to automatically "get" from
the SCCS copy of the file.

--

Ryan Anderson
sometimes Pug Majere

2005-02-08 19:20:45

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

On Tue, Feb 08, 2005 at 03:44:17PM +0000, Matthew Wilcox wrote:
> On Tue, Feb 08, 2005 at 01:23:48PM +0100, Roman Zippel wrote:
> > Enabling the following in the Makefile should have the same effect:
> >
> > # For maximum performance (+ possibly random breakage, uncomment
> > # the following)
> >
> > #MAKEFLAGS += -rR
>
> This reduces the debug output even further (and size of debug output is
> strongly correlated with time taken to do a null build):
>
> -rw-r--r-- 1 willy willy 65582214 2005-02-07 21:13 vanilla.debug
> -rw-r--r-- 1 willy willy 51413770 2005-02-07 22:17 nosuffixes.debug
> -rw-r--r-- 1 willy willy 37245484 2005-02-08 09:56 maxperf.debug
>
> Seems like it gets rid of the RCS and SCCS rules -- certainly a big
> improvement, and I'm not sure anyone really uses those rules.
The SCCS rules is the sole reason why -rR has not been enabled.

In my inbox I have a patch that enables SCCS support for all files.
Today it fails for Kconfig files at least.

I'm willing to give it a try. But we will only see people complaining
when it hits linus tree. -mm users uses quilt and the like - and thus
will not be hit by this.

Sam

2005-02-08 19:27:17

by Kai Germaschewski

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

On Tue, 8 Feb 2005, Sam Ravnborg wrote:

> The SCCS rules is the sole reason why -rR has not been enabled.

An easy way to make sure that the SCCS business is not a factor would be
to explicitly put the SCCS rules into the Makefile -- it's just two lines.

This way one could easily make sure there are no other problems incurred
(I wouldn't think so, but...), and tackle the SCCS/bk business later.

--Kai

2005-02-08 21:23:25

by J.A. Magallon

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler


On 2005.02.08, Matthew Wilcox wrote:
> On Tue, Feb 08, 2005 at 01:23:48PM +0100, Roman Zippel wrote:
> > Enabling the following in the Makefile should have the same effect:
> >
> > # For maximum performance (+ possibly random breakage, uncomment
> > # the following)
> >
> > #MAKEFLAGS += -rR
>

aic7xxx fails if you select to build firmware and use -R.
-R suppress the variable definitions, so a rule for lex and yacc
is missing and aicasm fails to build.

A rule for lex and yacc could be added somewhere in kbuild...

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandrakelinux release 10.2 (Cooker) for i586
Linux 2.6.10-jam8 (gcc 3.4.3 (Mandrakelinux 10.2 3.4.3-3mdk)) #1


Attachments:
(No filename) (795.00 B)
(No filename) (189.00 B)
Download all attachments

2005-02-08 21:28:35

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

On Tue, Feb 08, 2005 at 08:20:27PM +0100, Sam Ravnborg wrote:
> In my inbox I have a patch that enables SCCS support for all files.
> Today it fails for Kconfig files at least.

I guess the kconfig system needs to try to make Kconfig files before
including them ... this works for me, checking a Kconfig file out of RCS:

--- scripts/kconfig/zconf.l 29 Jul 2003 17:02:27 -0000 1.1
+++ scripts/kconfig/zconf.l 8 Feb 2005 21:25:43 -0000
@@ -269,15 +269,24 @@ static void zconf_endhelp(void)
*/
FILE *zconf_fopen(const char *name)
{
- char *env, fullname[PATH_MAX+1];
+ char *env, fullname[PATH_MAX+6];
FILE *f;

f = fopen(name, "r");
+ if (!f) {
+ sprintf(fullname, "make %s", name);
+ system(fullname);
+ f = fopen(name, "r");
+ }
if (!f && name[0] != '/') {
env = getenv(SRCTREE);
if (env) {
- sprintf(fullname, "%s/%s", env, name);
- f = fopen(fullname, "r");
+ sprintf(fullname, "make %s/%s", env, name);
+ f = fopen(fullname + 5, "r");
+ if (!f) {
+ system(fullname);
+ f = fopen(fullname + 5, "r");
+ }
}
}
return f;

I bet someone else can do it better than this ... I'm sure we don't need
to invoke sh to invoke make ;-)

> I'm willing to give it a try. But we will only see people complaining
> when it hits linus tree. -mm users uses quilt and the like - and thus
> will not be hit by this.
>
> Sam

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain

2005-02-09 05:04:28

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] Makefiles are not built using a Fortran compiler

Hi Kai - long time..

> > The SCCS rules is the sole reason why -rR has not been enabled.
>
> An easy way to make sure that the SCCS business is not a factor would be
> to explicitly put the SCCS rules into the Makefile -- it's just two lines.

Yup, I will do that when 2.6.11 opens up.
If other rules are needed I will add them.

Sam