From owner-freebsd-ppc@freebsd.org Sat Mar 2 20:17:52 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 9F6E5150DB01 for ; Sat, 2 Mar 2019 20:17:52 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-9.consmr.mail.gq1.yahoo.com (sonic315-9.consmr.mail.gq1.yahoo.com [98.137.65.33]) (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 45EF7814F3 for ; Sat, 2 Mar 2019 20:17:51 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: B0Oa4z4VM1m21146NCZx7fPGXyvSCM_EpoYPTMp_66BUKwgT.De9yYKgqAscm64 WNFw_Xyuh9hWZxzEn0.VdxWee4FADJk4ghthbR9eNwccNc0td9hsqYl3v4EGdLkx6oheOq19z06M 0gyFBnoBmWjrD7Wl8eDaxQY6jMqSPWgHZTIPdpzKnuB9Zg_uiK1tHxP4Yuwukd0wkklUhC_clI66 9vnlWuMU2P6e68TyYcGOIGv9IYsJng7wzBYAAbQS1w4YQ2q9VWwk4UeJdYTHwY_o5RXfWpLGesLJ DYA4nmqDmq4.E_eX56.gZA7hEPYhj0ADpep_fTLlwL2A0eyrUBpEHGoIBTFu.r7tdQykr167rhKf jBTDg1Chuwlf545Eu7HNKIUvPIyu8m1PR0nQWzxVOm7Qs6B4_PkYgxih8jLmdRhkfZd3fwf.2O.2 2hUqAVqmGv4p0d0DA_U2bw5GbzpZpnjIUoSwj4RmS0xNog1n4Vsu8AvgyYu.trVQ1F0lsQeNwQWC DinXFFG3WljJpSky1da1erxk8prQZYWni.kBf_4QefOsyayfYcrnu1NFrcteL_6JKZ5CRBKIre6n BX3LVPYt1jZp1o5vFyOWR5GpQwEpjRd5hCeaFxvux6Yfc7YVhrAPYxhrO.jZKFPXfpDjQ8BvLU3X BdWRihB71NLNR8iLvBHb.LX8i2n0CIV0.9UdTFduKcYKs.ZKlDnZ21PVP_YEZNlW5bDrwY6oWpbQ 7iZkyCqwk6N0PYiGcx4lyd6vO521iwUwBOyuiEv5ewCrJj9iuJE_gHjZl_H1SWCXmgS.E6id020X l9isSoq1LoRbRZsGBtzzkG2AlIhaTYFVYnYgKRevaqXFtf1SnPnTttgbR7tdXbltuzuXSVj37fi3 SANixPdBH8744R5QA.dUwZ8c6qxWf5qSWwv6ph8kzAh5Sqs8SmEEMgS.Rlf63ZZNBoVf.25PLJHz 8743x4YhrbybYWjZHHvhsSV2hRLm.ah9VcTnHBLzfFys1YCJ135goLeHqEmiZvIkXyFJxOAEQjSU ICQtQKdIvhkufThOD.MIw.kvCJ5AlbCLgEaVYAodNX1wsi2ElwVyMbbQqoF82ZPpwLjA- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Sat, 2 Mar 2019 20:17:44 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.113]) ([67.170.167.181]) by smtp416.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 0ea625337651e9767f232be8b735f5f8; Sat, 02 Mar 2019 20:07:34 +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: <87D6CBD5-AE55-4EC8-8797-D8A9DC3D5A5A@yahoo.com> Date: Sat, 2 Mar 2019 12:07:33 -0800 Cc: Bruce Evans , freebsd-hackers Hackers , FreeBSD PowerPC ML Content-Transfer-Encoding: 7bit Message-Id: References: <20190228145542.GT2420@kib.kiev.ua> <20190228150811.GU2420@kib.kiev.ua> <962D78C3-65BE-40C1-BB50-A0088223C17B@yahoo.com> <28C2BB0A-3DAA-4D18-A317-49A8DD52778F@yahoo.com> <20190301112717.GW2420@kib.kiev.ua> <20190302043936.A4444@besplex.bde.org> <20190301194217.GB68879@kib.kiev.ua> <87D6CBD5-AE55-4EC8-8797-D8A9DC3D5A5A@yahoo.com> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 45EF7814F3 X-Spamd-Bar: ++++ X-Spamd-Result: default: False [4.12 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(1.91)[ip: (7.81), ipnet: 98.137.64.0/21(1.00), asn: 36647(0.80), country: US(-0.07)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(0.82)[0.820,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_MEDIUM(0.98)[0.981,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.92)[0.925,0]; RCVD_IN_DNSWL_NONE(0.00)[33.65.137.98.list.dnswl.org : 127.0.5.0]; FREEMAIL_CC(0.00)[optusnet.com.au] 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: Sat, 02 Mar 2019 20:17:52 -0000 On 2019-Mar-1, at 13:19, Mark Millard wrote: > On 2019-Mar-1, at 11:42, Konstantin Belousov wrote: > >> . . . >> +#ifdef _LP64 >> + scale_bits = ffsl(scale); >> +#else >> + scale_bits = ffsll(scale); >> +#endif. . . >> + if (__predict_false(scale_bits + fls(delta) > 63)) { > > > The patch from yesterday uniformly used: > > int > fls(int mask) > { > int bit; > > if (mask == 0) > return (0); > for (bit = 1; mask != 1; bit++) > mask = (unsigned int)mask >> 1; > return (bit); > } > > that looks for the most significant 1 bit. > > The new patch uses in some places: > > int > ffsl(long mask) > { > int bit; > > if (mask == 0) > return (0); > for (bit = 1; !(mask & 1); bit++) > mask = (unsigned long)mask >> 1; > return (bit); > } > > that looks for the least significant 1 bit. Similarly > for: > > int > ffsll(long long mask) > { > int bit; > > if (mask == 0) > return (0); > for (bit = 1; !(mask & 1); bit++) > mask = (unsigned long long)mask >> 1; > return (bit); > } > > Was that deliberate? Be that as it may: I've been watching you and Bruce work on a code update. I'm intending to wait until you let me know you want me to test before trying again (on the PowerMac G5). (I've not been testing on anything else: I did not intended to test systems I've not seen a problem with until after the G5 seemed to be working.) In part my waiting is because the first patch that I tried left things unusable and I have to recover from the consequences of a forced power off. It took a fair amount of time. I'd not be surprised if the G5 type of context has another problem, separate from what I reported and what you are working on. If so I may not be able to be an effective tester: the fix may just repeat what I saw the first time (based on a messed up context). === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)