Date: Sun, 13 Apr 2014 23:20:38 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: desrt@desrt.ca, John-Mark Gurney <jmg@funkthat.com>, "freebsd-hackers@freebsd.org" <hackers@freebsd.org> Subject: Re: [CFR] Kevent timer improvements Message-ID: <20140413202038.GE4016@kib.kiev.ua> In-Reply-To: <20140413191928.GE17898@ivaldir.etoilebsd.net> References: <20140310131632.GI6900@ithaqua.etoilebsd.net> <CAJ-Vmok7ODK7FfJaHiQej8Za4-JH6Aryctk577vM9cYpeUcHew@mail.gmail.com> <20140310180404.GI32089@funkthat.com> <20140413131550.GD17898@ivaldir.etoilebsd.net> <20140413142028.GD4016@kib.kiev.ua> <20140413191928.GE17898@ivaldir.etoilebsd.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--1ccMZA6j1vT5UqiK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 13, 2014 at 09:19:28PM +0200, Baptiste Daroussin wrote: > On Sun, Apr 13, 2014 at 05:20:28PM +0300, Konstantin Belousov wrote: > > On Sun, Apr 13, 2014 at 03:15:51PM +0200, Baptiste Daroussin wrote: > > > I have splitted my patch in multiple parts, let start with the first = one: > > > adding NOTE_NSECONDS, NOTE_USECONDS, NOTE_NSECONDS > > >=20 > > > http://people.freebsd.org/~bapt/kevent_timer.diff > >=20 > [...] > > > + else if (flags & NOTE_NSECONDS) > > > + modifier =3D SBT_1NS; > > It is better to put the 'modifier =3D SBT_1MS;' statement as the else p= art. > >=20 > > That said, IMO it would be sometimes beneficial to have real flag to > > specify milliseconds precision, in addition to milliseconds be the > > default. >=20 > Done in the new patch > > > + > > > + timer2sbintime(kn->kn_sdata, kn->kn_sfflags), 0 /* 1ms? */, > > There, at least the comment about precision should be updated. > > But, it seems that for the seconds precision, it makes sense to > > specify e.g. 1/2 sec as precision; or add an API flag to allow imprecise > > callout scheduling. > >=20 > While I do agree this might be useful I do not have time to work on that = right > now so I just removed the comment which wasn't really accurate anyway. >=20 > Is that ok? Leave XXX comment right near the zero argument, at least ? > + if (flags & NOTE_SECONDS) > + modifier =3D SBT_1S; > + else if (flags & NOTE_USECONDS) > + modifier =3D SBT_1US; > + else if (flags & NOTE_NSECONDS) > + modifier =3D SBT_1NS; > + else > + modifier =3D SBT_1MS; There should be a case for NOTE_MSECONDS. Hm, I think the checks should be made stronger. System should ensure that only one flag is passed, and no invalid flags are supplied, right ? --1ccMZA6j1vT5UqiK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTSvGWAAoJEJDCuSvBvK1BaJAQAKVotjhdPfMsh855kgC4+tFO AXteFBGHV7ZS0kC9/vpL9fPS8CxOgDbeaJsrJlnFI2b0+07hL9VZckeGEdM/OZbP vKmzWV4N7Uk51s8cjMO3b27Ogq0n3f74kim7iHRLDW+F9aMOftpDWVr+IoJ9NqvN K2gZ20auBvukIrmsWk8K6e57j/N/ou6huDzcVyPTbej6/Si2eCRkSHCoPq3VZbBy KNYXq4EYC10sMYVD1kRdtPfCuqTdfUs2JdtkVPKOyBUbJKIUPy5XOxUKEELMLaxt /mR10n/3IukxWmrQmJighW89vCy9cmaFf5kwXZNOevBTNt63OKOKBBe80ZXnT6lx GMI8m9tSam0/AGJaWyNHkhNSBZp5HnGH7ARcPI9i8uoV7Ju20xyGy9teuib/G2oe qJOKddQg1YhaPs6HwC49qbos2ynJ0f5cApgoB3P1AqmbwgzCo7iFX2ou3WcgG55l hrRG/m7qo/08hCGDxdkd2Zm3e9UEGEifhd6hMvreYHEJbH+c9Bphlpo0Z0eSmDYh 5uCasja8HnEgH5oy5I2Id3+5vn4SuzvLOWDuCVqI54lyA3JksP37VGn3Zhz0/nMc e1SV28SQtoj/0bpZHuLQAHuAL4sD6oIrCkuTqkn4AHTBd/S3dzsvx82KZGKiMis/ 8Tx6VBK85C+hsh6UMU9Q =qihh -----END PGP SIGNATURE----- --1ccMZA6j1vT5UqiK--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140413202038.GE4016>