public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	peterz@infradead.org, ia6432@inbox.ru, roland@redhat.com,
	tglx@linutronix.de, mingo@elte.hu
Subject: Re: [tip:timers/urgent] posix timers: fix RLIMIT_CPU && fork()
Date: Tue, 24 Mar 2009 19:26:51 +0100	[thread overview]
Message-ID: <20090324182651.GA13408@redhat.com> (raw)
In-Reply-To: <tip-37bebc70d7ad4144c571d74500db3bb26ec0c0eb@git.kernel.org>

On 03/23, Oleg Nesterov wrote:
>
> Commit-ID:  37bebc70d7ad4144c571d74500db3bb26ec0c0eb
> Gitweb:     http://git.kernel.org/tip/37bebc70d7ad4144c571d74500db3bb26ec0c0eb
> Author:     Oleg Nesterov <oleg@redhat.com>
> AuthorDate: Mon, 23 Mar 2009 20:34:11 +0100
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Mon, 23 Mar 2009 20:43:35 +0100
>
> posix timers: fix RLIMIT_CPU && fork()
>
> See http://bugzilla.kernel.org/show_bug.cgi?id=12911
>
> copy_signal() copies signal->rlim, but RLIMIT_CPU is "lost". Because
> posix_cpu_timers_init_group() sets cputime_expires.prof_exp = 0 and thus
> fastpath_timer_check() returns false unless we have other cpu timers.
>
> This is the minimal fix for 2.6.29 (tested) and 2.6.28. The patch is not
> optimal,

Ingo, please drop this patch, it is very suboptimal.

My intent was to make the obviously correct patch for 2.6.29, but since
it was already released I'll send another one.

And,

> we need further cleanups here. With this patch update_rlimit_cpu()
> is not really needed, but I don't think it should be removed.
>
> The proper fix (I think) is:
>
> 	- set_process_cpu_timer() should just start the cputimer->running
> 	  logic (it does), no need to change cputime_expires.xxx_exp

I am stupid, of course we should set cputime_expires.xxx_exp to avoid
the slow path in run_posix_cpu_timers().

Oleg.


  reply	other threads:[~2009-03-24 18:31 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
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 [this message]
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=20090324182651.GA13408@redhat.com \
    --to=oleg@redhat.com \
    --cc=hpa@zytor.com \
    --cc=ia6432@inbox.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=tglx@linutronix.de \
    /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