From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28449 invoked from network); 17 Apr 2007 14:42:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Apr 2007 14:42:26 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 6959 invoked from network); 17 Apr 2007 14:42:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Apr 2007 14:42:20 -0000 Received: (qmail 13056 invoked by alias); 17 Apr 2007 14:42:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23294 Received: (qmail 9854 invoked from network); 17 Apr 2007 14:15:32 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Apr 2007 14:15:32 -0000 Received: (qmail 76548 invoked from network); 17 Apr 2007 14:15:32 -0000 Received: from cs1.cs.huji.ac.il (132.65.16.10) by a.mx.sunsite.dk with SMTP; 17 Apr 2007 14:15:27 -0000 Received: from serin.cs.huji.ac.il ([132.65.80.149]) by cs1.cs.huji.ac.il with esmtp id 1HdoSt-0009rs-0h; Tue, 17 Apr 2007 17:15:27 +0300 Received: from alsbergt by serin.cs.huji.ac.il with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1HdoSt-000Eer-0J; Tue, 17 Apr 2007 17:15:27 +0300 Date: Tue, 17 Apr 2007 17:15:26 +0300 From: Tom Alsberg To: Micah Cowan Cc: David Peer , Zsh Workers List Subject: Re: Bug in ulimit ? Message-ID: <20070417141526.GA56078@cs.huji.ac.il> References: <462493C0.20700@cowan.name> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <462493C0.20700@cowan.name> X-Face: "5"j@Y1Peoz1;ftTv>\|['ox-csmV+:_RDNdi/2lSe2x?0:HVAeVW~ajwQ7RfDlcb^18eJ;t,O,s5-aNdU/DJ2E8h1s,..4}N9$27u`pWmH|;s!zlqqVwr9R^_ji=1\3}Z6gQBYyQ]{gd5-V8s^fYf{$V2*_&S>eA|SH@Y\hOVUjd[5eah{EO@gCr.ydSpJHJIU[QsH~bC?$C@O:SzF=CaUxp80-iknM(]q(W David Peer wrote: > > If the user run: ulimit -t 0, he can run jobs without any cputime > > limitation: > > This sounds more like a kernel problem to me than a zsh bug. I get the > same behavior on my Ubuntu 7.04 (beta) system, in _bash_. > > I note that getrlimit(2) says: > > In 2.6.x kernels before 2.6.17, a RLIMIT_CPU limit of 0 is wrongly > treated as "no limit" (like RLIM_INFINITY). Since kernel 2.6.17, set‐ > ting a limit of 0 does have an effect, but is actually treated as a > limit of 1 second. > > However, I'm running 2.6.20(-14-generic), and still experiencing that > symptom. -- Tom Alsberg - hacker (being the best description fitting this space) Web page: http://www.cs.huji.ac.il/~alsbergt/ DISCLAIMER: The above message does not even necessarily represent what my fingers have typed on the keyboard, save anything further. --KsGdsel6WgEHnImy Content-Type: message/rfc822 Content-Disposition: attachment; filename="lkml-cpulimit.mail" >>From alsbergt@cs.huji.ac.il Tue Apr 17 16:57:55 2007 Date: Tue, 17 Apr 2007 16:57:55 +0300 From: Tom Alsberg To: Linux-Kernel Mailing List Subject: CPU time limit patch / setrlimit(RLIMIT_CPU, 0) cheat fix Message-ID: <20070417135755.GA55049@cs.huji.ac.il> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline X-Face: "5"j@Y1Peoz1;ftTv>\|['ox-csmV+:_RDNdi/2lSe2x?0:HVAeVW~ajwQ7RfDlcb^18eJ;t,O,s5-aNdU/DJ2E8h1s,..4}N9$27u`pWmH|;s!zlqqVwr9R^_ji=1\3}Z6gQBYyQ]{gd5-V8s^fYf{$V2*_&S>eA|SH@Y\hOVUjd[5eah{EO@gCr.ydSpJHJIU[QsH~bC?$C@O:SzF=CaUxp80-iknM(]q(Wgroup_leader); *old_rlim = new_rlim; task_unlock(current->group_leader); @@ -1937,15 +1947,6 @@ unsigned long rlim_cur = new_rlim.rlim_cur; cputime_t cputime; - if (rlim_cur == 0) { - /* - * The caller is asking for an immediate RLIMIT_CPU - * expiry. But we use the zero value to mean "it was - * never set". So let's cheat and make it one second - * instead - */ - rlim_cur = 1; - } cputime = secs_to_cputime(rlim_cur); read_lock(&tasklist_lock); spin_lock_irq(¤t->sighand->siglock); --XsQoSWH+UP9D9v3l-- --KsGdsel6WgEHnImy--