From owner-freebsd-current@FreeBSD.ORG Thu Feb 5 16:19:10 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD2FA31E for ; Thu, 5 Feb 2015 16:19:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8582F1FF for ; Thu, 5 Feb 2015 16:19:10 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-54-116-245.nwrknj.fios.verizon.net [173.54.116.245]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 192ECB91E; Thu, 5 Feb 2015 11:19:07 -0500 (EST) From: John Baldwin To: Luigi Rizzo Subject: Re: PSA: If you run -current, beware! Date: Thu, 05 Feb 2015 10:48:54 -0500 Message-ID: <8273349.HE1luBF2tk@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <20150205152223.GA59664@onelab2.iet.unipi.it> References: <8089702.oYScRm8BTN@overcee.wemm.org> <2613155.3ZBxDvY16q@ralph.baldwin.cx> <20150205152223.GA59664@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 05 Feb 2015 11:19:07 -0500 (EST) Cc: Konstantin Belousov , freebsd-current@freebsd.org, Peter Wemm X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 05 Feb 2015 16:19:10 -0000 On Thursday, February 05, 2015 04:22:23 PM Luigi Rizzo wrote: > On Thu, Feb 05, 2015 at 08:21:45AM -0500, John Baldwin wrote: > > On Thursday, February 05, 2015 08:48:33 AM Luigi Rizzo wrote: > ... > > > > > > It is fixed (in the proper meaning of the word, not like worked > > > > > around, > > > > > covered by paper) by the patch at the end of the mail. > > > > > > > > > > We already have a story trying to enable much less ambitious option > > > > > -fno-strict-overflow, see r259045 and the revert in r259422. I do > > > > > not > > > > > see other way than try one more time. Too many places in kernel > > > > > depend on the correctly wrapping 2-complement arithmetic, among > > > > > others > > > > > are callweel and scheduler. > > > > > > Rather than depending on a compiler option, wouldn't it be better/more > > > robust to change ticks to unsigned, which has specified wrapping > > > behavior? > > > > Yes, but non-trivial. It's also not limited to ticks. Since the compiler > > knows when it would apply these optimizations, it would be nice if it > > could > > warn instead (GCC apparently has a warning, but clang does not). Having > > people do a manual audit of every signed integer expression in the tree > > will take a long time. > > I think I misunderstood the problem as being limited to ticks, > which is probably only one symptom of a fundamental change in behaviour > of the compiler. > Still, it might be worthwhile start looking at ints that ought to be > implemented as u_int I actually agree, I just think we are stuck with -fwrapv in the interval, but it's probably not a short interval. I think converting ticks to unsigned would be a good first start. -- John Baldwin