[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100614212150.4dcb1feb.akpm@linux-foundation.org>
Date: Mon, 14 Jun 2010 21:21:50 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Paul Mackerras <paulus@...ba.org>
Cc: tytso@....edu, Salman <sqazi@...gle.com>, mingo@...e.hu,
linux-kernel@...r.kernel.org, peterz@...radead.org,
tytso@...gle.com, torvalds@...ux-foundation.org, walken@...gle.com,
Chen Liqin <liqin.chen@...plusct.com>,
Lennox Wu <lennox.wu@...il.com>
Subject: Re: [PATCH] Fix a race in pid generation that causes pids to be
reused immediately.
On Tue, 15 Jun 2010 13:26:08 +1000 Paul Mackerras <paulus@...ba.org> wrote:
> On Mon, Jun 14, 2010 at 06:55:56PM -0700, Andrew Morton wrote:
>
> > > kernel/sched_clock.c: if (cmpxchg64(&scd->clock, old_clock, clock) != old_cloc
> >
> > I guess that'll flush out any stragglers.
>
> And break most non-x86 32-bit architectures, including 32-bit powerpc.
If CONFIG_SMP=y, yes. On UP there's a generic implementation
(include/asm-generic/cmpxchg-local.h, include/asm-generic/cmpxchg.h)
> Fortunately that code is only used if CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
> is set, and it looks like only x86 and ia64 set it.
>
If that happens then the best fix is for those architectures to get
themselves a cmpxchg64(). Unless for some reason it's simply
unimplementable? Worst case I guess one could use a global spinlock.
Second-worst-case: hashed spinlocks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists