Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Jul 2013 21:11:08 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Ed Maste <emaste@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov <kib@FreeBSD.org>
Subject:   Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern]
Message-ID:  <51D317BC.9020204@FreeBSD.org>
In-Reply-To: <CAPyFy2Bd8Vpg4o%2BuNfitRhoe7at96b6JYmCbm37tmG4VO=VMuw@mail.gmail.com>
References:  <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <CAPyFy2Bd8Vpg4o%2BuNfitRhoe7at96b6JYmCbm37tmG4VO=VMuw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 02/07/2013 20:59 Ed Maste said the following:
> On 2 July 2013 12:48, Andriy Gapon <avg@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51D317BC.9020204>