linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@osdl.org>,
	linas@austin.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: PATCH: Race in 2.6.0-test2 timer code
Date: Wed, 30 Jul 2003 13:22:06 +0200	[thread overview]
Message-ID: <20030730112206.GJ23835@dualathlon.random> (raw)
In-Reply-To: <Pine.LNX.4.44.0307301232220.13891-100000@localhost.localdomain>

On Wed, Jul 30, 2003 at 12:34:39PM +0200, Ingo Molnar wrote:
> 
> On Wed, 30 Jul 2003, Andrea Arcangeli wrote:
> 
> > I never did any 2.6 patch, so it maybe a different thing what you've
> > seen, not what I applied to 2.4. Infact even the 2.4 patch isn't from
> > me.
> 
> the 2.4 timer-scalability patches do have a problem: due to TIMER_BH the
> actual timer expiry can happen on a different CPU, which opens up a
> del_timer()/add_timer() race in the itimer code. Your patch closes that
> hole.
> 
> But on 2.6 the timer will run precisely on the CPU it was added, so i
> think the race is not possible.

sure, the timer will run in the CPU it was added, and the setitimer will
run in a random cpu depending where the process is been rescheduled too
between the last setitimer, and the current setitimer.  (it's not the
timer moving, it's the process!)

The only way I can imagine this race not triggering in 2.6 and my old
2.4-aa, is by using cpu bindings, of course if you bind the app that
triggers the crash to a single cpu, there's no risk of triggering this.

Also note, the 2.4 code I included is different from what you mention,
I'm definitely enforcing to run the timer always and exactly in the same
cpu it was added. that's why it needs the hooks in the local timer
interrupts of x86, x86-64 and I added it a few weeks ago to ia64 too,
near the per-process accounting, and it can't run the timers from the
global timer irq anymore. Currently only IA64, AMD64 and x86 provides
the feature, other archs still fallbacks in the global timer irq and
they behave as you described, and for them the scalability is lower of
course. But on the archs where this bug triggered it was behaving 100%
like 2.6 since it was x86.

Andrea

  parent reply	other threads:[~2003-07-30 11:19 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-29 15:41 PATCH: Race in 2.6.0-test2 timer code linas
2003-07-29 20:56 ` Andrew Morton
2003-07-30  5:57   ` Ingo Molnar
2003-07-30  6:36     ` Andrew Morton
2003-07-30  7:07       ` Ingo Molnar
2003-07-30  7:34         ` Andrea Arcangeli
2003-07-30  7:34           ` Ingo Molnar
2003-07-30  8:28             ` Andrea Arcangeli
2003-07-30 10:31               ` Ingo Molnar
2003-07-30 11:16                 ` Andrea Arcangeli
2003-07-30 11:49                   ` Ingo Molnar
2003-07-30 12:34                     ` Andrea Arcangeli
2003-07-30 21:18                       ` linas
2003-07-30 22:06                         ` Andrea Arcangeli
2003-07-30 22:17                           ` Andrea Arcangeli
2003-07-31  7:04                             ` Ingo Molnar
2003-07-30 21:19                       ` Andrea Arcangeli
2003-07-30 23:43                 ` linas
2003-07-30 23:56                   ` Andrea Arcangeli
2003-07-30 23:54                     ` Andrew Morton
2003-07-31  0:16                       ` Andrea Arcangeli
2003-07-31 17:23                     ` linas
2003-08-01  6:27                       ` Ingo Molnar
2003-07-30  7:40           ` Ingo Molnar
2003-07-30  8:37             ` Andrea Arcangeli
2003-07-30 10:34               ` Ingo Molnar
2003-07-30 10:51                 ` Andrew Morton
2003-07-30 11:28                   ` Andrea Arcangeli
2003-07-30 11:22                 ` Andrea Arcangeli [this message]
2003-07-30 20:05     ` linas
2003-07-31  6:50       ` Ingo Molnar
2003-07-31 22:56     ` linas
2003-08-01  6:23       ` Ingo Molnar

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=20030730112206.GJ23835@dualathlon.random \
    --to=andrea@suse.de \
    --cc=akpm@osdl.org \
    --cc=linas@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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;
as well as URLs for NNTP newsgroup(s).