public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Peter Lojkin <ia6432@inbox.ru>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	rjw@sisk.pl
Subject: Re: 2.6.28, limiting cpu time doesn't work
Date: Mon, 23 Mar 2009 00:11:11 +0100	[thread overview]
Message-ID: <20090322231111.GA21775@redhat.com> (raw)
In-Reply-To: <E1LlVpr-0000Rv-00.ia6432-inbox-ru@f62.mail.ru>

On 03/23, Peter Lojkin wrote:
>
> Oleg Nesterov wrote:
>
> > Found this message on http://bugzilla.kernel.org/show_bug.cgi?id=12911 ...
> >
> > I _think_ posix_cpu_timers_init_group() is not right, it should copy
> > cputime_expires->prof_exp.
> >
> > Peter, any chance you can test the (uncompiled/untested) patch below?
>
> yes, with this patch 2.6.28.8 works as expected, thank you!

Great, thanks!

> if you need to test any more patches on the subject i'm ready to do it.
> regression test system for our project depends on ability to limit cpu time,
> so it's major problem for us...

I am not sure what should we do, this needs more discussion.

Probably the most simple patch for -stable and 2.6.29 is below.
(with this patch we don't even need update_rlimit_cpu(), afaics).

Oleg.

--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -1263,7 +1263,8 @@ static inline int fastpath_timer_check(s
 		if (task_cputime_expired(&group_sample, &sig->cputime_expires))
 			return 1;
 	}
-	return 0;
+
+	return sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY;
 }
 
 /*


  reply	other threads:[~2009-03-22 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 18:34 2.6.28, limiting cpu time doesn't work Peter Lojkin
2009-03-22 20:14 ` Oleg Nesterov
2009-03-22 22:08   ` Peter Lojkin
2009-03-22 23:11     ` Oleg Nesterov [this message]
2009-03-23 16:43       ` Ingo Molnar
2009-03-23 19:34         ` [PATCH, for 2.6.29] BUG 12911: fix RLIMIT_CPU && fork() Oleg Nesterov
2009-03-23 19:45           ` [tip:timers/urgent] posix timers: " Oleg Nesterov
2009-03-24 18:26             ` Oleg Nesterov
2009-03-24 21:05               ` Ingo Molnar
2009-03-24 21:34                 ` Oleg Nesterov
2009-03-24  2:43       ` 2.6.28, limiting cpu time doesn't work Peter Lojkin

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=20090322231111.GA21775@redhat.com \
    --to=oleg@redhat.com \
    --cc=ia6432@inbox.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rjw@sisk.pl \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox