From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cantor2.suse.de ([195.135.220.15]:58750 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753410Ab3IWM0T (ORCPT ); Mon, 23 Sep 2013 08:26:19 -0400 Date: Mon, 23 Sep 2013 14:26:14 +0200 From: David Sterba To: Rongqing Li Cc: linux-btrfs@vger.kernel.org, sandeen@redhat.com Subject: Re: [PATCH] btrfs-progs: Add dependencies explicitly to fix a parallel build issue Message-ID: <20130923122614.GN6810@suse.cz> Reply-To: dsterba@suse.cz References: <1379466661-27973-1-git-send-email-rongqing.li@windriver.com> <20130918145117.GC6810@twin.jikos.cz> <523E429F.8010606@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <523E429F.8010606@windriver.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Sun, Sep 22, 2013 at 09:06:39AM +0800, Rongqing Li wrote: > I want to know how many cores your cpu has? I can not reproduce it on > my 2 cores cpu, but it always happens when run on a server which is > a 16 cores cpu and "make -j20" Depends on what you call a core, I've tested this on a box with 8 cpu cores and 64 logical cpus. I can clearly see that the build is stalled for a few moments at '[SH] version.h' before it proceeds to '[CC] ...'. > >The dependency files are generated by an implicit rule .c -> .o.d, so > >there should be no problem for any of the files listed above. > > Do you means the below: > > .c.o: > $(Q)$(check) $< > @echo " [CC] $@" > $(Q)$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $< Rather %.o.d: %.c $(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(AM_CFLAGS) $(CFLAGS) $< the .o.d files are included at the end of Makefile, I'm not completely sure that they get included before the .c.o rule is processed. That way the .o.d files would be empty and the dependency on version.h missing. david