From owner-freebsd-stable@freebsd.org Mon Jan 16 16:59:25 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 522F8CAF9D6 for ; Mon, 16 Jan 2017 16:59:25 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from smtp.rlwinm.de (smtp.rlwinm.de [148.251.233.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF0611FF for ; Mon, 16 Jan 2017 16:59:24 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from crest-2.local (unknown [87.253.189.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.rlwinm.de (Postfix) with ESMTPSA id 53B8311242 for ; Mon, 16 Jan 2017 17:59:22 +0100 (CET) Subject: Re: buildworld build times 10-stable vs. 11-stable To: freebsd-stable@freebsd.org References: From: Jan Bramkamp Message-ID: Date: Mon, 16 Jan 2017 17:59:21 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 16:59:25 -0000 On 15/01/2017 17:40, Dan Mack wrote: > I have a system which builds world, kernel, install, boot, installworld, > reboot several times per week. I just noticed that my build times > increased from about (just cherry picking a couple build logs): > > Starting build of FreeBSD SVN [309852] 10.3-STABLE > Kernel will be GENERIC > building world ... 90:35 0 > > > Starting build of FreeBSD SVN [312099] 11.0-STABLE > Kernel will be GENERIC > building world ... 146:23 0 > > before I start bisecting the log files, is there something obvious > introduced in 11 that I missed that would explain the roughly 50 minute > difference in my build times? clang? additional subsystems? > > I'm using the same zpool / disks / memory etc. If you're compiling often enough for this to be an issue use the new bmake meta mode. In meta mode make keeps metadata gathered by the kernel and exported to make over filemon(4) around. With this a `make -sj4 buildworld buildkernel` after a small change (e.g. next patch) takes less than 3 minutes on my old SandyBridge dual-core ThinkPad X220 with cold file system caches. To enable it run `echo WITH_META_MODE=yes >/etc/src-env.conf`, instruct the kld rc.d script to load filemon with `sysrc kld_list+=" filemon"` and use the rc.d script to load the kernel module with `service kld start` (or reboot). The next buildworld and buildkernel will store the metadata in /usr/obj. Any builds of similar versions after that will have drastically shorter build times. This optimization is available starting with FreeBSD 11.0.