Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Dec 2017 13:37:25 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Eugene Grosbein <eugen@grosbein.net>, FreeBSD Stable <freebsd-stable@FreeBSD.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: idprio(1) broken
Message-ID:  <92a254fb-8066-4930-e4ad-f4fedb0e84d0@FreeBSD.org>
In-Reply-To: <5A4213DC.20508@grosbein.net>
References:  <5A421212.4040703@grosbein.net> <5A4213DC.20508@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 26/12/2017 11:18, Eugene Grosbein wrote:
> On 26.12.2017 16:10, Eugene Grosbein wrote:
> 
>> Is idprio(1) broken in stable/11?
>>
>> As root, start one bzip2 instance with idprio and one additional bzip2 intance per CPU core:
>>
>> # idprio 5 bzip2 -9 </dev/zero >/dev/null &
>> # n=$(sysctl -n kern.smp.cpus)
>> # i=1; while [ $i -le $n ]; do bzip2 -9 </dev/zero >/dev/null & i=$(($i+1)); done
>> # top
>>
>> For dual core system, I see that idprio'd bzip2 takes all cycles of first core
>> and two "normal" bzip2's share cycles of second core each taking ~50% of CPU time.
>>
>> It is expected that idprio'd bzip2 get no CPU time at all and each of "normal" bzip2's
>> get ~100% of single CPU core for such setup.
> 
> This works as expected for stable/10.

Seems to work as expected on head as well.
Tested on a 6-core physical system and a 2-core bhyve VM.

# ps axwwl | fgrep bzip2
   0 943  935   0 129  5 10564  2196 -        RN    1  0:00.00 idprio 5 bzip2 -9
   0 945  935   0 108  5 18332  9676 -        RN    1  1:16.15 bzip2 -9
   0 946  935   0 108  5 18332  9676 -        RN    1  1:16.34 bzip2 -9

idprio isn't even able to exec bzip2.

# ps axwwl | fgrep bzip2
    0 28986 86816   0 129  5   18348    2324 -        RN   17       0:00.02 bzip2 -9
    0 28988 86816   0 106  5   18348    9680 -        RN   17       1:27.25 bzip2 -9
    0 28989 86816   0 106  5   18348    9680 -        RN   17       1:27.86 bzip2 -9
    0 28990 86816   0 108  5   18348    9680 -        RN   17       1:35.50 bzip2 -9
    0 28991 86816   0 106  5   18348    9680 -        RN   17       1:27.00 bzip2 -9
    0 28992 86816   0 106  5   18348    9680 -        RN   17       1:25.83 bzip2 -9
    0 28993 86816   0 106  5   18348    9680 -        RN   17       1:26.76 bzip2 -9

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?92a254fb-8066-4930-e4ad-f4fedb0e84d0>