From: Anton Farygin <rider@altlinux.com>
To: ALT Linux Sisyphus discussion list <sisyphus@altlinux.ru>
Subject: Re: [sisyphus] USB on 2.4.x
Date: Wed, 02 Feb 2005 19:10:22 +0300
Message-ID: <4200FB6E.7050902@altlinux.com> (raw)
In-Reply-To: <200502021747.14473.serpiph@nikiet.ru>
Epiphanov Sergei wrote:
>В сообщении от 2 Февраль 2005 16:27 Anton Farygin написал:
>
>
>>Программу в студию ;-)
>>
>>
>
>Вот она (приложена).
>
>
>
>------------------------------------------------------------------------
>
>#include <string.h>
>#include <sys/time.h>
>#include <sys/resource.h>
>#include <signal.h>
>#include <stdio.h>
>#include <unistd.h>
>
>struct timeval getTV;
>struct timezone getTZ;
>double prevValue=0.0, curValue=0.0;
>
>
>void sigHand( int i ){
> gettimeofday( &getTV, &getTZ );
> prevValue = curValue;
> curValue = getTV.tv_sec+(double)getTV.tv_usec/1.0e6;
>}
>
>int main( int argc, char ** argv ) {
>
> ::setpriority( PRIO_PROCESS, 0, -19 );
> struct sigaction sa;
> memset( &sa, 0, sizeof(sa) );
> sa.sa_handler = sigHand;
> sigaction( SIGALRM, &sa, NULL );
>
> struct itimerval tv;
> tv.it_interval.tv_sec = 0;
> tv.it_interval.tv_usec = 30000;
> tv.it_value.tv_sec = 0;
> tv.it_value.tv_usec = 30000;
> setitimer( ITIMER_REAL, &tv, NULL );
>
> while( 1 ) {
> pause();
>// printf("%10.3f\n",curValue);
> printf("Cur=%16.6fs, Prev=%16.6fs, delta=%8.3fms\n",curValue,prevValue,(curValue-prevValue)*1.0e3);
> }
>}
>
>
Вот результат для 2.2, 2.6 и 2.4 ядер ( я интервал увеличил до 300ms):
2.2:
Cur=1107358666.289005s, Prev=1107358665.989036s, delta= 299.969ms
Cur=1107358666.588971s, Prev=1107358666.289005s, delta= 299.966ms
Cur=1107358666.888938s, Prev=1107358666.588971s, delta= 299.967ms
Cur=1107358667.188906s, Prev=1107358666.888938s, delta= 299.968ms
Cur=1107358667.488872s, Prev=1107358667.188906s, delta= 299.966ms
Cur=1107358667.788839s, Prev=1107358667.488872s, delta= 299.967ms
Cur=1107358668.088806s, Prev=1107358667.788839s, delta= 299.967ms
2.4.:
Cur=1107358603.118778s, Prev=1107358602.818756s, delta= 300.022ms
Cur=1107358603.418673s, Prev=1107358603.118778s, delta= 299.895ms
Cur=1107358603.718774s, Prev=1107358603.418673s, delta= 300.101ms
Cur=1107358604.018626s, Prev=1107358603.718774s, delta= 299.852ms
Cur=1107358604.318607s, Prev=1107358604.018626s, delta= 299.981ms
Cur=1107358604.618551s, Prev=1107358604.318607s, delta= 299.944ms
Cur=1107358604.918511s, Prev=1107358604.618551s, delta= 299.960ms
Cur=1107358605.218481s, Prev=1107358604.918511s, delta= 299.970ms
2.6.10:
Cur=1107358798.689482s, Prev=1107358798.388537s, delta= 300.945ms
Cur=1107358798.990423s, Prev=1107358798.689482s, delta= 300.941ms
Cur=1107358799.291367s, Prev=1107358798.990423s, delta= 300.944ms
Cur=1107358799.592312s, Prev=1107358799.291367s, delta= 300.945ms
Cur=1107358799.893255s, Prev=1107358799.592312s, delta= 300.943ms
Cur=1107358800.194198s, Prev=1107358799.893255s, delta= 300.943ms
Cur=1107358800.495143s, Prev=1107358800.194198s, delta= 300.945ms
Cur=1107358800.796087s, Prev=1107358800.495143s, delta= 300.944ms
Cur=1107358801.097030s, Prev=1107358800.796087s, delta= 300.943ms
Что интересно - разброс на 2.4 явно больше, но на 2.6 явно выше
результат, но при этом точность намного выше.
Так может быть что-то не так в методике тестирования ?
При чем независимо от интервала превышение примерно 1ms.
Кстати, google на эту тему нашел вот что:
http://www.ussg.iu.edu/hypermail/linux/kernel/0408.3/0119.html
Посмотрите, может быть у вас в коде подобная ошибка ?
Rgds,
Rider
next prev parent reply other threads:[~2005-02-02 16:10 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-01 22:14 Andrey Brindeew
2005-02-01 22:47 ` Vitaly Lipatov
2005-02-02 2:03 ` Ivan Fedorov
2005-02-02 5:46 ` Vitaly Lipatov
2005-02-02 7:17 ` Gleb Kulikov
2005-02-02 10:27 ` Alexandre Prokoudine
2005-02-02 14:45 ` Gleb Kulikov
2005-02-02 11:45 ` iLL
2005-02-02 12:06 ` Epiphanov Sergei
2005-02-02 12:45 ` iLL
2005-02-02 13:09 ` Epiphanov Sergei
2005-02-02 13:27 ` Anton Farygin
2005-02-02 14:47 ` Epiphanov Sergei
2005-02-02 16:10 ` Anton Farygin [this message]
2005-02-03 8:21 ` Epiphanov Sergei
2005-02-03 10:58 ` Epiphanov Sergei
2005-02-03 12:33 ` [sisyphus] timers on 2.6.x vs 2.4.x (was: Re: USB on 2.4.x) Sergey Vlasov
2005-02-03 13:41 ` Epiphanov Sergei
2005-02-03 12:32 ` [sisyphus] USB on 2.4.x Epiphanov Sergei
2005-02-02 14:43 ` Gleb Kulikov
2005-02-02 22:12 ` Vitaly Lipatov
2005-02-03 7:59 ` Gleb Kulikov
2005-02-03 9:59 ` Vitaly Lipatov
2005-02-07 19:20 ` Serge Pavlovsky
2005-02-02 14:39 ` Gleb Kulikov
2005-02-02 15:42 ` [sisyphus] " Konstantin A. Lepikhov
2005-02-02 7:34 ` [sisyphus] Mosix (was: USB on 2.4.x) iLL
2005-02-03 5:24 ` [sisyphus] USB on 2.4.x Andrey Brindeew
2005-02-03 5:34 ` Ivan Fedorov
2005-02-03 8:21 ` Valery V. Inozemtsev
2005-02-03 13:45 ` Anton Farygin
2005-02-08 17:10 ` Maxim Tyurin
2005-02-02 6:35 ` Alex Yustasov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4200FB6E.7050902@altlinux.com \
--to=rider@altlinux.com \
--cc=sisyphus@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git