OpenSolaris

Printable Version Enter a New Search
Bug ID 6592975
Synopsis Sparc platforms can be compiled in parallel
State 10-Fix Delivered (Fix available in build)
Category:Subcategory consolidation:os-net-misc
Keywords build | nitro | parallel
Responsible Engineer Alexander Kolbasov
Reported Against
Duplicate Of
Introduced In
Commit to Fix snv_85
Fixed In snv_85
Release Fixed solaris_nevada(snv_85)
Related Bugs 6591892 , 6591900 , 6592974 , 6592977 , 6592976
Submit Date 15-August-2007
Last Update Date 12-March-2008
Description
It is possible to compile uts and lib in parallel since there are no dependencies. Library 
build parallelism is quite low, so this change improves total build time.
Currently during ON build all sparc platforms (sun4v, sun4u and sparc) are compiled 
sequentially. It should be possible to compile them in parallel. The trick is to build sun4u/genunix first since everyone depends on it.
The fix is dependent on two additional bugs:

6591892 ipf/netinet/Makefile incorrectly tries to install ip_icmp.h
6591900 Various sun4u platforms try to install sys symlink in usr/share/src/uts in parallel

Here is the build dependency analysis obtained with the help of DTrace script monitoring
sparc build.

sparc/ip conflicts
==================

usr/src/uts/sparc/ip is entered 51 times:

sun4v/genunix dependency on ipctf comes from the following rules in
sun4v/genunix/Makefile:

$(IPCTF_TARGET) ipctf_target: FRC
	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
	@pwd

$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
	$(CTFMERGE_GENUNIX_MERGE)
	$(POST_PROCESS)


    usr/src/uts/sun4v                   	install 
     usr/src/uts/sun4v/unix             	install 
       usr/src/uts/sun4v/genunix        	all.targ 
        usr/src/uts/sparc/ip            	ipctf.debug64 

     usr/src/uts/sun4v/genunix          	install 
       usr/src/uts/sparc/ip             	ipctf.debug64 

After that the CPU_KMODS (generic niagara niagara2 vfalls) are built which do
symcheck in sun4v/genunix which causes traces like this for each of CPU_KMODS
(see Makefile.sun4v/shared). Note that CPU_KMODS are built serially explicitely
with .NO_PARALLEL directive.

     usr/src/uts/sun4v/generic          	install 
       usr/src/uts/sun4v/generic        	def.targ 
        usr/src/uts/sun4v/unix          	symcheck 
         usr/src/uts/sun4v/genunix      	all.targ 
          usr/src/uts/sparc/ip          	ipctf.debug64 

...

Now the path through sun4u -> sun4u/genunix which have similar rules in
sun4u/genunix/Makefile:

$(IPCTF_TARGET) ipctf_target: FRC
	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
	@pwd

$(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
	$(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
	$(CTFMERGE_GENUNIX_MERGE)
	$(POST_PROCESS)

    usr/src/uts/sun4u                   	install 
     usr/src/uts/sun4u/unix             	install 
       usr/src/uts/sun4u/genunix        	all.targ 
        usr/src/uts/sparc/ip            	ipctf.debug64 

sun4u/unix also wants to build sun4u/genunix (why?) and goes through

     usr/src/uts/sun4u/genunix          	install 
      usr/src/uts/sun4u/genunix         	install.targ 
       usr/src/uts/sparc/ip             	ipctf.debug64 
        usr/src/uts/sparc/ip            	debug64/ipctf.a 

Again, CPU_KMODS do symcheck in usr/src/uts/sun4u/unix. CPU kmods are
cheetah cheetahplus jalapeno serrano spitfire hummingbird.
They all go through

     usr/src/uts/sun4u/cheetah          	install 
      usr/src/uts/sun4u/cheetah         	install.targ 
       usr/src/uts/sun4u/cheetah        	def.targ 
        usr/src/uts/sun4u/unix          	symcheck 
         usr/src/uts/sun4u/genunix      	all.targ 
          usr/src/uts/sparc/ip          	ipctf.debug64 

Note that CPU_KMODS are built serially explicitely with .NO_PARALLEL directive,
so they do not represent a potential race between them.


Now, several sun4u platforms have rules in their sun4u subdirs that always build
GENLIB:

$(GENLIB):	FRC
	@(cd $(GENLIB_DIR); pwd; $(MAKE) all.targ)
	@pwd

It is rebuilt as a dependency on GENLIB in LIBS. The platforms that do this are
opl, serengeti, starcat and starfire. Note that they go to sun4u/genunix twice -
once for the install.targ and another time for symcheck:

Starfire:

 usr/src/uts/sun4u                      	install
  usr/src/uts/sun4u/starfire            	install 
   usr/src/uts/sun4u/starfire/unix      	install 
    usr/src/uts/sun4u/starfire/unix     	install.targ 
     usr/src/uts/sun4u/genunix          	all.targ 
      usr/src/uts/sparc/ip              	ipctf.debug64 
   usr/src/uts/sun4u/starfire/spitfire  	install 
    usr/src/uts/sun4u/starfire/spitfire 	install.targ 
     usr/src/uts/sun4u/starfire/spitfire	def.targ 
      usr/src/uts/sun4u/starfire/unix   	symcheck 
       usr/src/uts/sun4u/genunix        	all.targ 
        usr/src/uts/sparc/ip            	ipctf.debug64 
         usr/src/uts/sparc/ip           	debug64/ipctf.a 

Serengeti:

Serengeti visits sun4u/genunix three times because of cheetah and cheetahplus:

 usr/src/uts/sun4u                      	install
  usr/src/uts/sun4u/serengeti           	install 
   usr/src/uts/sun4u/serengeti/unix     	install 
    usr/src/uts/sun4u/serengeti/unix    	install.targ 
     usr/src/uts/sun4u/genunix          	all.targ 
      usr/src/uts/sparc/ip              	ipctf.debug64 
   usr/src/uts/sun4u/serengeti/cheetah  	install 
    usr/src/uts/sun4u/serengeti/cheetah 	install.targ 
     usr/src/uts/sun4u/serengeti/cheetah	def.targ 
      usr/src/uts/sun4u/serengeti/unix  	symcheck 
       usr/src/uts/sun4u/serengeti/unix 	symcheck.targ 
        usr/src/uts/sun4u/genunix       	all.targ 
         usr/src/uts/sparc/ip           	ipctf.debug64 
   usr/src/uts/sun4u/serengeti/cheetahplus	install 
    usr/src/uts/sun4u/serengeti/cheetahplus	install.targ 
     usr/src/uts/sun4u/serengeti/cheetahplus	def.targ 
      usr/src/uts/sun4u/serengeti/unix  	symcheck 
       usr/src/uts/sun4u/serengeti/unix 	symcheck.targ 
        usr/src/uts/sun4u/genunix       	all.targ 
         usr/src/uts/sparc/ip           	ipctf.debug64 

starcat:

starcat is similar to serengeti:

 usr/src/uts/sun4u                      	install
  usr/src/uts/sun4u/starcat             	install 
   usr/src/uts/sun4u/starcat/unix       	install 
    usr/src/uts/sun4u/starcat/unix      	install.targ 
     usr/src/uts/sun4u/genunix          	all.targ 
      usr/src/uts/sparc/ip              	ipctf.debug64 
   usr/src/uts/sun4u/starcat/cheetah    	install 
    usr/src/uts/sun4u/starcat/cheetah   	install.targ 
     usr/src/uts/sun4u/starcat/cheetah  	def.targ 
      usr/src/uts/sun4u/starcat/unix    	symcheck 
       usr/src/uts/sun4u/starcat/unix   	symcheck.targ 
        usr/src/uts/sun4u/genunix       	all.targ 
         usr/src/uts/sparc/ip           	ipctf.debug64 
   usr/src/uts/sun4u/starcat/cheetahplus	install 
    usr/src/uts/sun4u/starcat/cheetahplus	install.targ 
     usr/src/uts/sun4u/starcat/cheetahplus	def.targ 
      usr/src/uts/sun4u/starcat/unix    	symcheck 
       usr/src/uts/sun4u/starcat/unix   	symcheck.targ 
        usr/src/uts/sun4u/genunix       	all.targ 
         usr/src/uts/sparc/ip           	ipctf.debug64 

opl:

 usr/src/uts/sun4u                      	install
  usr/src/uts/sun4u/opl                 	install 
   usr/src/uts/sun4u/opl/unix           	install 
    usr/src/uts/sun4u/opl/unix          	install.targ 
     usr/src/uts/sun4u/genunix          	all.targ 
      usr/src/uts/sparc/ip              	ipctf.debug64 

   usr/src/uts/sun4u/opl/olympus_c      	install 
    usr/src/uts/sun4u/opl/olympus_c     	install.targ 
     usr/src/uts/sun4u/opl/olympus_c    	def.targ 
      usr/src/uts/sun4u/opl/unix        	symcheck 
       usr/src/uts/sun4u/opl/unix       	symcheck.targ 
        usr/src/uts/sun4u/genunix       	all.targ 
         usr/src/uts/sparc/ip           	ipctf.debug64 

Finally we build uts/sparc which tries to build sparc/ip as well:

 usr/src/uts/sparc                      	install
  usr/src/uts/sparc/ip                  	install 
   usr/src/uts/sparc/ip                 	install.targ 

So we have the following potential race:

uts subdirs:  sun4v sun4u sparc

sun4u platforms:
  unix opl serengeti starcat starfire
  unix and CPU_KMODS = { 
		cheetah cheetahplus jalapeno serrano spitfire hummingbird 
  }

  If CPU_KMODS are built in parallel this creates a race with CPU_KMODS

*** sun4u/genassym conflicts

sun4u install target has a depoendency on genassym which causes

   usr/src/uts                          	2m15s    1h23m43s install 
    usr/src/uts/sun4u                   	18m32s   53m18s   install 
     usr/src/uts/sun4u/genassym         	18m33s   7s       install 
      usr/src/uts/sun4u/genassym        	18m33s   7s       def.targ 

Several sun4u subdirss also have a dependency on genassym via DSF_DIR macro
defined in Makefile.sun4u.shared:

unix lw2plus lw8 opl serengeti starcat starfire zuluvm

     usr/src/uts/sun4u/unix             	18m40s   3m46s    install 
      usr/src/uts/sun4u/unix            	18m40s   3m45s    install.targ 
       usr/src/uts/sun4u/genassym       	18m41s   1s       all.targ 

CPU_KMODS do symcheck in sun4u/unix which goes to genassym:


     usr/src/uts/sun4u/cheetah          	25m54s   2m3s     install 
      usr/src/uts/sun4u/cheetah         	25m55s   2m3s     install.targ 
       usr/src/uts/sun4u/cheetah        	25m55s   2m2s     def.targ 
        usr/src/uts/sun4u/unix          	26m7s    1m50s    symcheck 
         usr/src/uts/sun4u/genassym     	26m8s    1s       all.targ 
      ...

Also sparc/dtrace has a dependency on genassym:

#
#	Rule to generate assym.h
#
$(ASSYM_H): FRC
x	@cd $(DSF_DIR); $(MAKE) all.targ


 usr/src/uts/sparc                      	1h11m49s          install
  usr/src/uts/sparc/dtrace              	1h11m50s 4m10s    install 
   usr/src/uts/sparc/dtrace             	1h11m50s 4m10s    install.targ 
    usr/src/uts/sun4u/genassym          	1h11m51s 2s       all.targ 

So, unix/genassym races are

unix CPU_KMODS and uts/sparc/dtrace

*** sun4v/genunix conflicts

Similar, for sun4v there is a potential conflict between sun4v/unix and
CPU_KMODS.

*** starcat/genassym conflicts

There is a potential starcat/* conflict over starcat/genassym

Similarly there is a potential serengeti/* conflict over serengeti/genassym

Same for starfire/* and opl/*

There is a conflict over sun4u/darwin platmod from darwin and from quasar since
quasar depends on darwin:

 usr/src/uts/sun4u                    install
  usr/src/uts/sun4u/darwin            install 
   usr/src/uts/sun4u/darwin/platmod   install 
 usr/src/uts/sun4u                    install
  usr/src/uts/sun4u/quasar            install 
   usr/src/uts/sun4u/darwin           install 
    usr/src/uts/sun4u/darwin/platmod  install
Work Around
N/A
Comments
N/A