From owner-freebsd-amd64@freebsd.org Sat Aug 19 11:15:24 2017 Return-Path: Delivered-To: freebsd-amd64@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 E0CB3DE2CD1 for ; Sat, 19 Aug 2017 11:15:24 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-185.reflexion.net [208.70.211.185]) (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 957067077C for ; Sat, 19 Aug 2017 11:15:24 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 32065 invoked from network); 19 Aug 2017 11:15:23 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 19 Aug 2017 11:15:23 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Sat, 19 Aug 2017 07:15:23 -0400 (EDT) Received: (qmail 16981 invoked from network); 19 Aug 2017 11:15:22 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 19 Aug 2017 11:15:22 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 167F7EC8877; Sat, 19 Aug 2017 04:15:22 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Disabling kernel hw-thread migration/stealing policies allows Ryzen to build lang/ghc (finally!) Date: Sat, 19 Aug 2017 04:15:21 -0700 References: <818D4BF7-481A-4031-8EEE-0971738268CC@dsl-only.net> To: freebsd-hackers , freebsd-amd64@freebsd.org In-Reply-To: <818D4BF7-481A-4031-8EEE-0971738268CC@dsl-only.net> Message-Id: <66044D90-E5C9-4855-B358-4083A82590CE@dsl-only.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Aug 2017 11:15:25 -0000 On 2017-Aug-19, at 2:38 AM, Mark Millard wrote: > [This test was suggesetd by Don Lewis's comment 73 > for buugzilla 221029.] > > I finally got a Ryzen based build of lang/ghc : > > # pkg search ghc > ghc-8.0.2_1 Compiler for the functional language Haskell > > This used as a kernel context with: > > sysctl kern.sched.balance=0 > sysctl kern.sched.steal_idle=0 > > and a poudriere context of: > > PARALLEL_JOBS=1 > ALLOW_MAKE_JOBS=no > > and ALLOW_MAKE_JOBS_PACKAGES not having a match > for lang/ghc > > The Ryzen was not otherwise loaded with activity > (beyond normal background stuff in a simple > configuration). > > (This means that kern.sched.balance=1 might > have worked as it had nothing to do. In fact > I have that test running now.) > > By contrast for the kernel context: > > sysctl kern.sched.balance=1 > sysctl kern.sched.steal_idle=1 > > the lang/ghc build fails quickly compared to > the somewhat over 1.5 hours it took for a > build to complete. > > The detailed build step for the failure tends to > vary from build attempt to build attempt. But they > tend to involve Bus Errors for the failures. > > > My context here is actually FreeBSD > running as a guest in a VirtualBox > virtual machine --that is running under > Windows 10 Pro . The Ryzen has all 16 > threads enabled but Virtual Box is set > to supply 8 "processors" to the virtual > machine (in VirtualBox terminology). > But Poudriere is set to avoid parallel > builds. > > Also: Prior build attempts had already > built packages for lang/ghc's > prerequisites. So the experiments here > are just for the lang/ghc related > build activity. sysctl kern.sched.balance=0 sysctl kern.sched.steal_idle=0 with: #PARALLEL_JOBS=1 ALLOW_MAKE_JOBS=yes and ALLOW_MAKE_JOBS_PACKAGES having a match for lang/ghc also makes it to completion for building lang/ghc . (Much of the time 8 hw-threads being busy.) Ryzen has problems with some aspect(s) of how FreeBSD migrates work between threads. May be some stronger form of barrier(s) or some such would sidestep the issue(s) but be less drastic than use of: sysctl kern.sched.balance=0 sysctl kern.sched.steal_idle=0 === Mark Millard markmi at dsl-only.net