should_yield problem [Was: svn commit: r251322 - head/sys/kern]

Attilio Rao attilio at freebsd.org
Tue Jul 2 17:12:57 UTC 2013


On Tue, Jul 2, 2013 at 6:48 PM, Andriy Gapon <avg at freebsd.org> wrote:
> on 03/06/2013 20:36 Konstantin Belousov said the following:
>> Author: kib
>> Date: Mon Jun  3 17:36:43 2013
>> New Revision: 251322
>> URL: http://svnweb.freebsd.org/changeset/base/251322
>>
>> Log:
>>   Be more generous when donating the current thread time to the owner of
>>   the vnode lock while iterating over the free vnode list.  Instead of
>>   yielding, pause for 1 tick.  The change is reported to help in some
>>   virtualized environments.
>
> Kostik,
>
> I've just run into a problem where word "generous" does not seem to be
> applicable at all unless I am mistaken about how the code works.

While "ticks" is signed it is used as an unsigned int.
td_swvolticks is always derived by ticks, which again will always be
used as an unisgned and then the subtractions among the 2 will be
consistent.

Attilio


--
Peace can only be achieved by understanding - A. Einstein


More information about the svn-src-head mailing list