public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: James Bottomley <James.Bottomley@steeleye.com>,
	Rusty Trivial Russell <trivial@rustcorp.com.au>
Cc: Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>,
	Jens Axboe <axboe@suse.de>, John Cherry <cherry@osdl.org>
Subject: Re: [TRIVIAL] fix parallel builds for aic7xxx]
Date: Wed, 24 Sep 2003 08:39:22 -0600	[thread overview]
Message-ID: <376620000.1064414362@aslan.scsiguy.com> (raw)
In-Reply-To: <1064412654.2063.3.camel@mulgrave>

> On Tue, 2003-09-23 at 21:56, Rusty Trivial Russell wrote:
>> [ Sorry, did you guys end up with consensus on this?  Should I forward
>>   or drop?  Thanks, Rusty ]
> 
> Justin, I think after some discussion you agreed this to be correct. 

Actually, no.  Here's the latest information on this issue that I
sent to both Sam and John:

Date: Wed, 17 Sep 2003 16:09:58 -0600
From: "Justin T. Gibbs" <gibbs@scsiguy.com>
Reply-To: "Justin T. Gibbs" <gibbs@scsiguy.com>
To: John Cherry <cherry@osdl.org>, Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [TRIVIAL][PATCH] fix parallel builds for aic7xxx]
Message-ID: <34280000.1063836597@aslan.btc.adaptec.com>
In-Reply-To: <1063129389.1512.39.camel@cherrypit.pdx.osdl.net>

> Justin,
> 
> I assume you are the scsi guy (I can take a clue).  Is Sam's patch for
> the aic7xxx Makefiles more acceptable to you?  How do we move this
> forward?

There are still problems with both patches.

Option 1 looks like this:

$(aic7xxx-gen-y): $(src)/aic7xxx.seq 

$(src)/aic7xxx.seq: $(obj)/aicasm/aicasm $(src)/aic7xxx.reg
	run assembler...

The .seq file is not a generated file, so unless you touch it,
this rule will always be invoked so long as the .seq file
is older than the .reg file.  This also means that if the .seq
file is newer than the reg file and aicasm, the assembler will
not run.

Option 2 looks like this:

$(aic7xxx-gen-y): $(src)/aic7xxx.seq $(src)/aic7xxx.reg
$(aic7xxx-gen-y): doaic7xasm

.PHONY: doaic7xasm
$(aic7xxx-gen-y): doaic7xasm

doaic7xasm: $(obj)/aicasm/aicasm
	run assembler ...

In this case, the assembler will aways be run since a phony
target that is a prerequisite to a real target will always
be executed (the make manual explicitly warns about this).
Running the assembler guarantees a recompile of the entire
driver.  Even if this were not the case, the generated files
would not be rebuilt if only the assembler changed.  This
strategy also seems to confuse make into attempting to pull
the generated files out of RCS/SCCS if, for example, you
have a BK tree.

What we really want is an order only pre-requisite, but not
all Linux installations have a make new enough to support this.
(This is the pipe prerequisite syntax).  Baring that, I plan
to just chain the generated files as a dependency which still
causes the assembler to be run multiple times if any generated
file is out of date, but at least the assembler will not be run
concurrently.  This also avoids having the files rebuilt on
each build.

It would be really nice if gnu make would grow a .ORDER target
like bmake so that you can selectively disable parallelism
on certain targets.

--
Justin

==== //depot/linux-aic79xx-2.4.0/drivers/scsi/aic7xxx/Makefile#15 - /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/Makefile ====
--- /tmp/tmp.12649.0	2003-09-17 16:03:52.000000000 -0600
+++ /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/Makefile	2003-09-17 15:49:06.000000000 -0600
@@ -64,8 +64,13 @@
 	$(LD) $(LD_RFLAG) -r -o $@ $(obj-aic79xx)
 
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aic7xxx_seq.h: aic7xxx_reg.h
 aic7xxx_gen = aic7xxx_seq.h aic7xxx_reg.h
 ifeq ($(CONFIG_AIC7XXX_REG_PRETTY_PRINT),y)
+aic7xxx_reg.h: aic7xxx_reg_print.c
 aic7xxx_gen += aic7xxx_reg_print.c
 aic7xxx_asm_cmd = aicasm/aicasm -I. -r aic7xxx_reg.h		\
 		 -p aic7xxx_reg_print.c -i aic7xxx_osm.h	\
@@ -79,8 +84,13 @@
 endif
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aic79xx_seq.h: aic79xx_reg.h
 aic79xx_gen = aic79xx_seq.h aic79xx_reg.h
 ifeq ($(CONFIG_AIC79XX_REG_PRETTY_PRINT),y)
+aic79xx_reg.h: aic79xx_reg_print.c
 aic79xx_gen += aic79xx_reg_print.c
 aic79xx_asm_cmd = aicasm/aicasm -I. -r aic79xx_reg.h		\
 		 -p aic79xx_reg_print.c -i aic79xx_osm.h	\
==== //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aicasm/Makefile#14 - /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aicasm/Makefile
====
--- /tmp/tmp.12649.7	2003-09-17 16:03:52.000000000 -0600
+++ /home/gibbs/bk/linux-2.4/drivers/scsi/aic7xxx/aicasm/Makefile	2003-09-17 15:49:09.000000000 -0600
@@ -49,11 +49,19 @@
 clean:
 	rm -f $(clean-files)
 
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aicasm_gram.c: aicasm_gram.h
 aicasm_gram.c aicasm_gram.h: aicasm_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) $<
 	mv $(<:.y=).tab.c $(<:.y=.c)
 	mv $(<:.y=).tab.h $(<:.y=.h)
 
+# Create a dependency chain in generated files
+# to avoid concurrent invocations of the single
+# rule that builds them all.
+aicasm_macro_gram.c: aicasm_macro_gram.h
 aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
 	$(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
 	mv $(<:.y=).tab.c $(<:.y=.c)


  reply	other threads:[~2003-09-24 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-24  2:56 [TRIVIAL] fix parallel builds for aic7xxx] Rusty Trivial Russell
2003-09-24 12:36 ` Christoph Hellwig
2003-09-24 14:10 ` James Bottomley
2003-09-24 14:39   ` Justin T. Gibbs [this message]
2003-09-24 16:21     ` John Cherry
2003-09-26  4:20       ` Rusty Russell
2003-09-26 15:02         ` John Cherry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=376620000.1064414362@aslan.scsiguy.com \
    --to=gibbs@scsiguy.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=axboe@suse.de \
    --cc=cherry@osdl.org \
    --cc=kai@tp1.ruhr-uni-bochum.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=trivial@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox