[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20070516172435.bd3270bd.akpm@linux-foundation.org>
Date: Wed, 16 May 2007 17:24:35 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Christoph Lameter <clameter@....com>
Cc: Andi Kleen <andi@...stfloor.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Oleg Nesterov <oleg@...sign.ru>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH 1/2] scalable rw_mutex
On Wed, 16 May 2007 16:40:59 -0700 (PDT) Christoph Lameter <clameter@....com> wrote:
> On Wed, 16 May 2007, Andrew Morton wrote:
>
> > (I hope. Might have race windows in which the percpu_counter_sum() count is
> > inaccurate?)
>
> The question is how do these race windows affect the locking scheme?
The race to which I refer here is if another CPU is running
percpu_counter_sum() in the window between the clearing of the bit in
cpu_online_map and the CPU_DEAD callout. Maybe that's too small to care
about in the short-term, dunno.
Officially we should fix that by taking lock_cpu_hotplug() in
percpu_counter_sum(), but I hate that thing.
I was thinking of putting a cpumask into the counter. If we do that then
there's no race at all: everything happens under fbc->lock. This would be
a preferable fix, if we need to fix it.
But I'd prefer that freezer-based cpu-hotplug comes along and saves us
again.
umm, actually, we can fix the race by using CPU_DOWN_PREPARE instead of
CPU_DEAD. Because it's OK if percpu_counter_sum() looks at a gone-away
CPU's slot.
-
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