From owner-freebsd-ppc@freebsd.org Fri Mar 8 01:30:04 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 DC172152DFD1 for ; Fri, 8 Mar 2019 01:30:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-22.consmr.mail.ne1.yahoo.com (sonic309-22.consmr.mail.ne1.yahoo.com [66.163.184.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A52A847A5 for ; Fri, 8 Mar 2019 01:30:03 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: z7zvHfUVM1mQmMyjx4YL2r07_97JyYrstZve3Kprd7hdb8Zf3FX97lkWdYwxOem K2rTM9be1lSJH0yuEcOwo5Y_k8ea01xm6t23GwJ7ygwcqU2OX7MfiRkd0BE_855EnA9xkvZzrzC_ hZIEB7PU9iMioc9RmA06Q51xjPHwK8HRwodgvDtbmjrOrSHA9hYMdbQO_leLQhqk_3mnAPRhCUK9 rg0TX3rXjrlUFb0xy32FJ2ta2UO4Zhlal63JsUZlhIqwr6YrZY8R7L2xM7bWPioYv8i59NaZtYAz kRMLHnqYtjS.U0qigzQ6Lwvf0_w37ZXjOcGhiOes9KFNj96rc4bE3_XQs9MqaRLzeVWYSAatz4tQ wca8vd6IZzAMs3xkUv1Ul4v7gcZzMiC_95BAYGo6kA9sN7z6AgsfTx_lxt7neFgthSyc81OZ2EqI lDsLQOT3Tl3LLqW87xR0kXAUdE9NTZyW7y1B4NNK8RMGnwFeXJec1guAf7RQ.55K89Do.zv9dUEA kBuOK_QvLZ3JkhKpISbVSEOzSFdL5mzHaOsVGMYwBgfGgAVZ.6ZMHDoMVnf5pYY7P_eEv9.XNNsG 8b3QGI7KlOksdMqNie3QfnFb_SMMWVAcSgqWxxpY4f2cYErrY4XJETCph4K4nIzplxe9fgYj30_7 QjhqetzjHOmYVqy4cx8S4LTDT57GfoBd3kRLY.6YVXSjEb1WvjY6LHnnFgggVrhAvSXA.U24EJxE F8VRxFRy04MVERSirC7mn6I0X0kBZ6mjrfRV9ZFdWJFpJ5hSavjOOR6s4.9nebI9iBjy2C51Y3i9 NmA0sT6_1315MSiC156DRUL1MU0t7GGSUCbWyvv8__d0wPatERnPbZqpMzbWvV1IfxJd06pFEvFx fr0X30.4Ga8AeYR_g6jg7F3r2_Wuf7yEz9Sl7536KbCPGZFLnUR.fttF1p6yrL0pz_PzJzSZIe1R VCkXhztBy3VMjKLyGCPFQ8U4MjMTT3B34beonXdJXa_44xixvLGSGrNnVt.7moNBKXiRGrRkzDOO F6Wgpyj565EcsXqeCr8E_H5H7qF5jcT1zzv9ZeZxaTu6vPZNEk03Yp9L4NxU5U8sbmOHTfg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ne1.yahoo.com with HTTP; Fri, 8 Mar 2019 01:29:56 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.113]) ([67.170.167.181]) by smtp428.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f665bae4c52bbab61751dd46e593eb0e; Fri, 08 Mar 2019 01:29:53 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: powerpc64 head -r344018 stuck sleeping problems: th->th_scale * tc_delta(th) overflows unsigned 64 bits sometimes [patched failed] From: Mark Millard In-Reply-To: <20190307222220.GK2492@kib.kiev.ua> Date: Thu, 7 Mar 2019 17:29:51 -0800 Cc: Bruce Evans , freebsd-hackers Hackers , FreeBSD PowerPC ML Content-Transfer-Encoding: 7bit Message-Id: <5EED3352-2E8C-4BEE-B281-4AC8DE9570C2@yahoo.com> References: <20190302142521.GE68879@kib.kiev.ua> <20190303041441.V4781@besplex.bde.org> <20190303111931.GI68879@kib.kiev.ua> <20190303223100.B3572@besplex.bde.org> <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> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 6A52A847A5 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Fri, 08 Mar 2019 01:30:04 -0000 A basic question and a small note. Question's context for it tc->tc_get_timecount(tc) values: In the powerpc64 context tc->tc_get_timecount(tc) is the lower 32 bits of the tbr, in my context having a 33,333,333 MHz or so increment rate for a machine with a 2.5 GHz or so clock rate. The truncated 32 bit tbr value wraps every 128 seconds or so. 2 sockets, 2 cores per socket, so 4 separate tbr values. The question is . . . In tc_delta's: tc->tc_get_timecount(tc) - th->th_offset_count is observing tc->tc_get_timecount(tc) < th->th_offset_count ever supposed to be possible in correct operation, other than tc->tc_get_timecount(tc) having wrapped around (and so being newly 0 or "near" 0, no evidence of of having it having been near 128 seconds or more for my context)? The note: On 2019-Mar-7, at 14:22, Konstantin Belousov wrote: > . . . > + > + if (__predict_false(delta < large_delta)) { I thought that delta=large_delta . > + /* Avoid overflow for scale * delta. */ > + x = (scale >> 32) * delta; > + bt->sec += x >> 32; > + bintime_addx(bt, x << 32); > + bintime_addx(bt, (scale & 0xffffffff) * delta); > + } else { > + bintime_addx(bt, scale * delta); > + } > . . . === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)