From owner-svn-src-head@FreeBSD.ORG Mon Oct 15 21:18:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A77989C; Mon, 15 Oct 2012 21:18:15 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id DF7648FC18; Mon, 15 Oct 2012 21:18:14 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q9FLIEVw054257; Mon, 15 Oct 2012 15:18:14 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q9FLIBXO087756; Mon, 15 Oct 2012 15:18:11 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib From: Ian Lepore To: Garrett Cooper In-Reply-To: References: <201210150821.q9F8Lobc047576@svn.freebsd.org> <20121015202615.GJ1383@garage.freebsd.pl> <1350333885.1123.153.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Mon, 15 Oct 2012 15:18:11 -0600 Message-ID: <1350335891.1123.160.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Maxim Sobolev , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 21:18:15 -0000 On Mon, 2012-10-15 at 13:52 -0700, Garrett Cooper wrote: > On Mon, Oct 15, 2012 at 1:44 PM, Ian Lepore > wrote: > > On Mon, 2012-10-15 at 22:26 +0200, Pawel Jakub Dawidek wrote: > >> On Mon, Oct 15, 2012 at 08:21:50AM +0000, Maxim Sobolev wrote: > >> > Author: sobomax > >> > Date: Mon Oct 15 08:21:49 2012 > >> > New Revision: 241576 > >> > URL: http://svn.freebsd.org/changeset/base/241576 > >> > > >> > Log: > >> > Add per-second scheduling into the cron(8). Right now it's > >> > only available via the new @every_second shortcut. ENOTIME to > >> > implement crontab(5) format extensions to allow more flexible > >> > scheduling. > >> > > >> > In order to address some concerns expressed by Terry Lambert > >> > while discussing the topic few years ago, about per-second cron > >> > possibly causing some bad effects on /etc/crontab by stat()ing > >> > it every second instead of every minute now (i.e. atime update), > >> > only check that database needs to be reloaded on every 60-th > >> > loop run. This should be close enough to the current behaviour. > >> > > >> > Add "@every_minute" shortcut while I am here. > >> > >> Do I read the code correctly and the cron deamon will wake up every > >> second now even if @every_second is not used at all? > > > > It appears to, which I don't think is a bad thing at all. But the way > > it waits is to wake up, do some work, and go back to sleep for an > > integer 1 second. That will occasionally lead to a second in which no > > wakeup happens, as the "do some work" part always takes some fraction of > > a second. > > This is silly. It should be waking up at the lowest common > denominator of time quanta, not every second; this could be determined > via the crontab its managing. In 1987 I would have been outraged at waking up at 1hz needlessly. Sitting here typing on a machine that's doing 12,000 interrupts/sec just to maintain clocks, and top shows interrupts using 0.0% cpu, it's hard to get too upset about a 1hz loop anymore. On the other hand, if people are going to rely on this new feature of being able to execute something every second, then the integer sleep needs to be changed to a nanosleep() calculated to truly wake up at a 1hz rate without eliding seconds now and then. -- Ian