[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061121210105.GA381@oleg>
Date: Wed, 22 Nov 2006 00:01:05 +0300
From: Oleg Nesterov <oleg@...sign.ru>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: Alan Stern <stern@...land.harvard.edu>,
Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [patch] cpufreq: mark cpufreq_tsc() as core_initcall_sync
On 11/21, Paul E. McKenney wrote:
>
> On Tue, Nov 21, 2006 at 12:56:21PM -0500, Alan Stern wrote:
> > Here's another potential problem with the fast path approach. It's not
> > very serious, but you might want to keep it in mind.
> >
> > The idea is that a reader can start up on one CPU and finish on another,
> > and a writer might see the finish event but not the start event. For
> > example:
>
> One approach to get around this would be for the the "idx" returned from
> srcu_read_lock() to keep track of the CPU as well as the index within
> the CPU. This would require atomic_inc()/atomic_dec() on the fast path,
> but would not add much to the overhead on x86 because the smp_mb() imposes
> an atomic operation anyway. There would be little cache thrashing in the
> case where there is no preemption -- but if the readers almost always sleep,
> and where it is common for the srcu_read_unlock() to run on a different CPU
> than the srcu_read_lock(), then the additional cache thrashing could add
> significant overhead.
If you are going to do this, it seems better to just forget about ->per_cpu_ref,
and use only ->hardluckref[]. This also allows to avoid the polling in
synchronize_srcu().
Oleg.
-
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