From owner-svn-src-head@FreeBSD.ORG Tue Jul 2 18:12:13 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E8345ED; Tue, 2 Jul 2013 18:12:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 12DAE1DD0; Tue, 2 Jul 2013 18:12:11 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA25999; Tue, 02 Jul 2013 21:12:04 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uu53b-0005FB-Sb; Tue, 02 Jul 2013 21:12:03 +0300 Message-ID: <51D317BC.9020204@FreeBSD.org> Date: Tue, 02 Jul 2013 21:11:08 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Ed Maste Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 18:12:13 -0000 on 02/07/2013 20:59 Ed Maste said the following: > On 2 July 2013 12:48, Andriy Gapon wrote: >> I am not sure if the originally reported problem was also caused by >> should_yield() or if it was something else. But in either case I think that we >> should fix should_yield. Perhaps (ticks - curthread->td_swvoltick) should be >> cast to unsigned before comparison? > > What about just initializing td_swvoltick to ticks at td creation? I like this idea. Still I think that distance between two wrapping numbers should be calculated properly even if that mostly would not matter in practice. distance = (signed)( i1 - i2 ) -- Andriy Gapon