From owner-freebsd-ppc@freebsd.org Wed Apr 3 07:01:00 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E58D1560354; Wed, 3 Apr 2019 07:01:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 6BEA09621A; Wed, 3 Apr 2019 07:00:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x3370lKJ077099 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 3 Apr 2019 10:00:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x3370lKJ077099 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x3370j6a077098; Wed, 3 Apr 2019 10:00:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 3 Apr 2019 10:00:45 +0300 From: Konstantin Belousov To: Michael Tuexen Cc: Bruce Evans , freebsd-hackers Hackers , FreeBSD PowerPC ML Subject: Re: powerpc64 head -r344018 stuck sleeping problems: th->th_scale * tc_delta(th) overflows unsigned 64 bits sometimes [patched failed] Message-ID: <20190403070045.GW1923@kib.kiev.ua> References: <20190303161635.GJ68879@kib.kiev.ua> <20190304043416.V5640@besplex.bde.org> <20190304114150.GM68879@kib.kiev.ua> <20190305031010.I4610@besplex.bde.org> <20190306172003.GD2492@kib.kiev.ua> <20190308001005.M2756@besplex.bde.org> <20190307222220.GK2492@kib.kiev.ua> <20190309144844.K1166@besplex.bde.org> <20190324110138.GR1923@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 07:01:00 -0000 On Wed, Apr 03, 2019 at 12:27:32AM +0200, Michael Tuexen wrote: > > On 24. Mar 2019, at 12:01, Konstantin Belousov wrote: > > > > On Sat, Mar 09, 2019 at 06:00:14PM +1100, Bruce Evans wrote: > >> I more strongly disclike (sic) the more complete merge. The central APIs > >> have even more parameters and reduced type safety to describe objects as > >> (offset, size) pairs. > > I changed the patch to be type-safe. Now I like it even more. It provides > > 1. internal > > 2. concise > > 3. type-safe > > API to fetch data from timehands. The implementation needs to be read > > only once. > Hi, > > I'm a bit lost... I think this started to fix a problem on G5 PowerMacs. > Do you think this patch solves the problem. Should this be tested? > Or is this still work in progress or a general improvement not necessary > fixing the problem on G5 PowerMacs? It started from a report of issues on G5. The specific issues are bugs on G5, and the posted patches do not fix them. From what I see, the timecounter values were wrapped. This is genuine ppc or G5 issue. The patch fixes time keeping subsystem reaction to the already bad situation, by correctly handling overflow in calculations. This overflow can occur in more reasonable setups as well, e.g. if ddb was activated and interrupts were stopped for prolonged period, even on x86. In addition, my version of the patch reorganizes the code and removes excessive copies of the most delicate loops in lock-less readers. This chunk can be split from the overflow part, but it is not completely trivial.