From owner-svn-src-all@FreeBSD.ORG Tue Jul 2 18:09:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 866D03D5; Tue, 2 Jul 2013 18:09:36 +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 2F4CF1D9F; Tue, 2 Jul 2013 18:09:34 +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 VAA25959; Tue, 02 Jul 2013 21:09:33 +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 1Uu51A-0005Ek-Uf; Tue, 02 Jul 2013 21:09:32 +0300 Message-ID: <51D31724.6090807@FreeBSD.org> Date: Tue, 02 Jul 2013 21:08:36 +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: attilio@FreeBSD.org Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <51D30CE8.7030803@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 18:09:36 -0000 on 02/07/2013 20:52 Attilio Rao said the following: > I was just pointing out that the real bug is not in the subtraction > itself but on the hogticks comparison. > This is because hogticks is not an absolute measurement but it > represents really a ticks difference. > In my opinion we should define hogticks as an unsigned int and add a > small comment saying that it is a differential. > This will fix the issue. I think that my original suggestion is equivalently well if not more obvious. This is a common knowledge: http://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution distance = (signed)( i1 - i2 ) -- Andriy Gapon