From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 3 Feb 2005 15:33:06 +0300 From: Sergey Vlasov To: ALT Linux Sisyphus discussion list Message-ID: <20050203123306.GP11017@master.mivlgu.local> Mail-Followup-To: ALT Linux Sisyphus discussion list References: <20050201221429.GA5775@abr.pp.ru> <200502021747.14473.serpiph@nikiet.ru> <4200FB6E.7050902@altlinux.com> <200502031358.32782.serpiph@nikiet.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/DkgDsqJFFamjKX0" Content-Disposition: inline In-Reply-To: <200502031358.32782.serpiph@nikiet.ru> Subject: [sisyphus] timers on 2.6.x vs 2.4.x (was: Re: USB on 2.4.x) X-BeenThere: sisyphus@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Linux Sisyphus discussion list List-Id: ALT Linux Sisyphus discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2005 12:33:13 -0000 Archived-At: List-Archive: --/DkgDsqJFFamjKX0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 03, 2005 at 01:58:27PM +0300, Epiphanov Sergei wrote: > =F7 =D3=CF=CF=C2=DD=C5=CE=C9=C9 =CF=D4 2 =E6=C5=D7=D2=C1=CC=D8 2005 19:10= Anton Farygin =CE=C1=D0=C9=D3=C1=CC: > > =FE=D4=CF =C9=CE=D4=C5=D2=C5=D3=CE=CF - =D2=C1=DA=C2=D2=CF=D3 =CE=C1 2.= 4 =D1=D7=CE=CF =C2=CF=CC=D8=DB=C5, =CE=CF =CE=C1 2.6 =D1=D7=CE=CF =D7=D9=DB= =C5 > > =D2=C5=DA=D5=CC=D8=D4=C1=D4, =CE=CF =D0=D2=C9 =DC=D4=CF=CD =D4=CF=DE=CE= =CF=D3=D4=D8 =CE=C1=CD=CE=CF=C7=CF =D7=D9=DB=C5. > > > > =F4=C1=CB =CD=CF=D6=C5=D4 =C2=D9=D4=D8 =DE=D4=CF-=D4=CF =CE=C5 =D4=C1= =CB =D7 =CD=C5=D4=CF=C4=C9=CB=C5 =D4=C5=D3=D4=C9=D2=CF=D7=C1=CE=C9=D1 ? > > > > =F0=D2=C9 =DE=C5=CD =CE=C5=DA=C1=D7=C9=D3=C9=CD=CF =CF=D4 =C9=CE=D4=C5= =D2=D7=C1=CC=C1 =D0=D2=C5=D7=D9=DB=C5=CE=C9=C5 =D0=D2=C9=CD=C5=D2=CE=CF 1ms. >=20 > =F1 =C4=CF=C2=C1=D7=C9=CC =D7 =D0=D2=CF=C7=D2=C1=CD=CD=D5 =D7=CB=CC=C0=DE= =C5=CE=C9=C5 SCHED_FIFO =D3 =CD=C1=CB=D3=C9=CD=C1=CC=D8=CE=D9=CD =D0=D2=C9= =CF=D2=C9=D4=C5=D4=CF=CD, > =CE=CF =CE=C9=DE=C5=C7=CF =CE=C5 =C9=DA=CD=C5=CE=C9=CC=CF=D3=D8...=20 > =D3=C2=CF=D2=CB=C1: > g++ -O3 -o speed speed.cpp >=20 > =FA=C1=D0=D5=D3=CB=C1=C0 =D0=CF=C4 root, =D7=C9=D6=D5 =D3=CC=C5=C4=D5=C0= =DD=C5=C5: > $ps axl | grep speed > F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMM= AND > 4 0 2560 2258 -100 - 2096 816 pause S<+ pts/9 0:00 ./sp= eed >=20 > =F0=D2=CF=C7=D2=C1=CD=CD=C1 =D7=D9=C4=C1=A3=D4 =D3=CC=C5=C4=D5=C0=DD=C5= =C5: >=20 > Cur=3D1107427818.387305s, Prev=3D1107427818.356308s, delta=3D 30.997ms > Cur=3D1107427818.418299s, Prev=3D1107427818.387305s, delta=3D 30.994ms > Cur=3D1107427818.449293s, Prev=3D1107427818.418299s, delta=3D 30.994ms > Cur=3D1107427818.480286s, Prev=3D1107427818.449293s, delta=3D 30.993ms > Cur=3D1107427818.511280s, Prev=3D1107427818.480286s, delta=3D 30.994ms > Cur=3D1107427818.542274s, Prev=3D1107427818.511280s, delta=3D 30.994ms > Cur=3D1107427818.573269s, Prev=3D1107427818.542274s, delta=3D 30.995ms > Cur=3D1107427818.604261s, Prev=3D1107427818.573269s, delta=3D 30.992ms > Cur=3D1107427818.635257s, Prev=3D1107427818.604261s, delta=3D 30.996ms >=20 > =F4=CF =C5=D3=D4=D8 =CC=C9=C2=CF =DE=D4=CF-=D4=CF =CE=C5 =D4=C1=CB =D0=C9= =DB=D5, =CC=C9=C2=CF =CE=C5 =D0=CF=CE=C9=CD=C1=C0 =D1=C4=D2=CF, =CC=C9=C2= =CF =D1=C4=D2=CF 2.6 =C9=D3=D0=CF=CC=D8=DA=D5=C5=D4 > =DE=D4=CF-=D4=CF =C9=CE=CF=C5 =C4=CC=D1 =CF=C2=C5=D3=D0=C5=DE=C5=CE=C9=D1= =C2=CC=C9=DA=CB=CF=C7=CF =CB realtime =D7=D2=C5=CD=C5=CE=C9 =C9=D3=D0=CF= =CC=CE=C5=CE=C9=D1. =EE=C1 =D3=C1=CD=CF=CD =C4=C5=CC=C5 =D0=D2=CF=C2=CC=C5=CD=C1 =D7 =C4=C1=CE= =CE=CF=CD =D3=CC=D5=DE=C1=C5 =D7 =D2=C1=DA=CC=C9=DE=CE=D9=C8 =C1=CC=C7=CF= =D2=C9=D4=CD=C1=C8 =D0=C5=D2=C5=D3=DE=A3=D4=C1 =D7=D2=C5=CD=C5=CE=CE=D9=C8 =C9=CE=D4=C5=D2=D7=C1=CC=CF=D7 =D7=CF =D7=CE=D5= =D4=D2=C5=CE=CE=C9=C5 =C5=C4=C9=CE=C9=C3=D9 =D1=C4=D2=C1 =D7 2.4.x =C9 2.6.= x. =F7 2.4.x =D7 kernel/itimer.c =C2=D9=CC=C9 =C4=CF=D7=CF=CC=D8=CE=CF =D0=D2= =CF=D3=D4=D9=C5 =C6=D5=CE=CB=C3=C9=C9 tvtojiffies() =C9 jiffiestotv(): static unsigned long tvtojiffies(struct timeval *value) { unsigned long sec =3D (unsigned) value->tv_sec; unsigned long usec =3D (unsigned) value->tv_usec; if (sec > (ULONG_MAX / HZ)) return ULONG_MAX; usec +=3D 1000000 / HZ - 1; usec /=3D 1000000 / HZ; return HZ*sec+usec; } static void jiffiestotv(unsigned long jiffies, struct timeval *value) { value->tv_usec =3D (jiffies % HZ) * (1000000 / HZ); value->tv_sec =3D jiffies / HZ; } =E4=CC=D1 =C1=D2=C8=C9=D4=C5=CB=D4=D5=D2=D9 i386 =D7 =D1=C4=D2=C1=C8 2.4.x = =C2=D9=CC=CF =D5=D3=D4=C1=CE=CF=D7=CC=C5=CE=CF HZ =3D=3D 100 (=D0=C5=D2=C9= =CF=C4 =D3=C9=D3=D4=C5=CD=CE=CF=C7=CF =D4=C1=CA=CD=C5=D2=C1 =D0=CF=CC=C1=C7=C1=CC= =D3=D1 =D2=C1=D7=CE=D9=CD 10 =CD=D3). =F7 =C6=D5=CE=CB=C3=C9=C9 tvtojiffie= s() =CF=CB=D2=D5=C7=CC=C5=CE=C9=C5 =D7=D3=C5=C7=C4=C1 =D0=D2=CF=C9=D3=C8=CF=C4= =C9=D4 =D7=D7=C5=D2=C8, =DE=D4=CF=C2=D9 =C9=CE=D4=C5=D2=D7=C1=CC =DA=C1=C4= =C5=D2=D6=CB=C9 =D7=D3=C5=C7=C4=C1 =C2=D9=CC =CE=C5 =CD=C5=CE=D8=DB=C5 =DA=C1=D0=D2=CF=DB=C5=CE=CE=CF=C7=CF. =F7 2.6.x =D3=C9=D4=D5=C1=C3=C9=D1 =DA=C1=CD=C5=D4=CE=CF =C9=DA=CD=C5=CE=C9= =CC=C1=D3=D8 =C9 =D5=D3=CC=CF=D6=CE=C9=CC=C1=D3=D8. =F0=D2=C5=D6=C4=C5 =D7= =D3=C5=C7=CF, =DE=C1=D3=D4=CF=D4=C1 =D3=C9=D3=D4=C5=CD=CE=CF=C7=CF =D4=C1=CA=CD=C5=D2=C1 =C4=CC=D1 i386 =C2=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), =C1 =D5=D6=C5 =CF=CB=D2=D5=C7=CC= =A3=CE=CE=CF=C5, =CB=CF=D4=CF=D2=CF=C5 =C9 =C2=D5=C4=C5=D4 =D7 =C4=C5=CA=D3=D4=D7=C9=D4=C5= =CC=D8=CE=CF=D3=D4=C9 =C9=D3=D0=CF=CC=D8=DA=CF=D7=C1=D4=D8=D3=D1 =D1=C4=D2= =CF=CD. --/DkgDsqJFFamjKX0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFCAhoCW82GfkQfsqIRAuwcAJ9nex/e9L40RvRkYncl/3vNsBW+4QCfUQlM nkVwX2PAVB8ZbOXNMZrDsCk= =C9DV -----END PGP SIGNATURE----- --/DkgDsqJFFamjKX0--