From owner-freebsd-current@freebsd.org Sat Feb 25 00:23:05 2017 Return-Path: Delivered-To: freebsd-current@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 7B068CECC81; Sat, 25 Feb 2017 00:23:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09DCDA59; Sat, 25 Feb 2017 00:23:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id u63so5200244wmu.2; Fri, 24 Feb 2017 16:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Gl0tK/UTK+/FnibmCokRYgh5owFlbr/ae5jF7BCf5Dw=; b=HJuwM4A+1w6wNb/sjsbbJ8U7LcDrRmboU3WP2wt2LB1CLUwQms4sltA+1AMGtaFtrt tB2/iiM72pwyVrHh6Ynrhb6GPqDfID0NJQiQlCj4o0Am8Oib/wfzzOmv2dtBPeiNnmGH t1NvW6rv2DscLQXFbsyT4oj0P0WnV7NBpshpvfa6KDMU3qjoURyUZcMxFEyiaCeFzMSH Tk/SONVrth64iEXR3e3vWJKvvy+oVhv14aOovAz74zNg+KMlnoemUO5msTpSGdeBeR2L 5szcAk6azM6tdXtP8xp3am0zaADO/pohrFz0DSkSCucuvHd07qmc8bFUDvsg5nbHrntA 5xpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Gl0tK/UTK+/FnibmCokRYgh5owFlbr/ae5jF7BCf5Dw=; b=WX/W8i88Lg4xJhLmp0ULAYdc0l8YirBc9WvRVKGKGQ0PkoIKc7KWTOn8+VVaGNoAEl HGWg3GTHoD27o9GYlBaAfnJow/t0IPnkLm5A/RYPau2jWD2XVOXwRKGu1jdapWkmIMQf Nu1UgoKqd8sLqkNZ8YmRW2OQGeLP7dv2HrV/KLaS6rye0baZeLQVJzQycl1FJhailWAg yRcJyq2mGGhowL2JtT7YtxKED/E/qk/AhqZia4tzj9NBVduyBlF8+aEkufK7MwIqeWri 4cfxL1iVl5Bn1RDlvJ3tQ6CSlzCzLWaIgF8SyCOqcOZy58Aw+nc/v/AgFWvo4U6jJDpn 2zVw== X-Gm-Message-State: AMke39mJw12M4XRupucTpuObR3z0s3HYxpFaAveoVYZgnzoQIiGjUU3e9SDJnYGEMI2+nQ== X-Received: by 10.28.6.210 with SMTP id 201mr4917622wmg.85.1487982183619; Fri, 24 Feb 2017 16:23:03 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id l130sm4233029wmf.0.2017.02.24.16.23.02 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 24 Feb 2017 16:23:03 -0800 (PST) Date: Sat, 25 Feb 2017 01:23:01 +0100 From: Mateusz Guzik To: Mark Millard Cc: mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current , Nathan Whitehorn Subject: Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works] Message-ID: <20170225002300.GC19697@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Mark Millard , mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current , Nathan Whitehorn References: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> <20170220191044.GA8526@dft-labs.eu> <5D5235E1-6F84-4329-8ED5-35FCDB0A6A71@dsl-only.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5D5235E1-6F84-4329-8ED5-35FCDB0A6A71@dsl-only.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 00:23:05 -0000 On Tue, Feb 21, 2017 at 01:37:25AM -0800, Mark Millard wrote: > [Back to the powerpc64 context.] > > On 2017-Feb-20, at 11:10 AM, Mateusz Guzik wrote: > > > On Sat, Feb 18, 2017 at 04:18:05AM -0800, Mark Millard wrote: > >> [Note: I experiment with clang based powerpc64 builds, > >> reporting problems that I find. Justin is familiar > >> with this, as is Nathan.] > >> > >> I tried to update the PowerMac G5 (a so-called "Quad Core") > >> that I have access to from head -r312761 to -r313864 and > >> ended up with random panics and hang ups in fairly short > >> order after booting. > >> > >> Some approximate bisecting for the kernel lead to: > >> (sometimes getting part way into a buildkernel attempt > >> for a different version before a failure happens) > >> > >> -r313266: works (just before use of atomic_fcmpset) > >> vs. > >> -r313271: fails (last of the "use atomic_fcmpset" check-ins) > >> > >> (I did not try -r313268 through -r313270 as the use was > >> gradually added.) > >> > >> So I'm currently running a -r313864 world with a -r313266 > >> kernel. > >> > >> No kernel that I tried that was from before -r313266 had the > >> problems. > >> > >> Any kernel that I tried that was from after -r313271 had the > >> problems. > >> > >> Of course I did not try them all in other direction. :) > >> > > > > I found that spin mutexes were not properly handling this, fixed in > > r313996. > > > > Locally I added a if (cpu_tick() % 2) return (0); snipped to amd64 > > fcmpset to simulate failures. Everything works, while it would easily > > fail without the patch. > > > > That said, I hope this concludes the 'missing check for not-reread value > > of failed fcmpset' saga. > > > > -- > > Mateusz Guzik > > -r313999 is an improvement for powerpc64: it boots and I can > log in on the old PowerMac G5 so-called "Quad Core". > > But, e.g., buildworld buildkernel eventually hangs and later > the powerpc64 panics for "spin lock held too long". > Allright, play time is over. Can you please: 1. verify r313254 is stable for you 2. apply https://people.freebsd.org/~mjg/patches/complete-locks.diff and https://people.freebsd.org/~mjg/.junk/ppc.diff on top of it and retry the test? This is a workaround which effectively disables the powerpc-specific primitive and makes it use a cmpset wrapper instead. I don't have the hardware to test right now and my attempts to boot in qemu also failed. That said, does not look like there are general fcmpset bugs left and the remaining issue seems powerpc-specific. If this works, I'll commit the workaround for the time being as in few weeks I'd like to start merging the work back to stable/11. -- Mateusz Guzik