Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031368AbWKUVBE (ORCPT ); Tue, 21 Nov 2006 16:01:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1031431AbWKUVBE (ORCPT ); Tue, 21 Nov 2006 16:01:04 -0500 Received: from host-233-54.several.ru ([213.234.233.54]:8381 "EHLO mail.screens.ru") by vger.kernel.org with ESMTP id S1031368AbWKUVBC (ORCPT ); Tue, 21 Nov 2006 16:01:02 -0500 Date: Wed, 22 Nov 2006 00:01:05 +0300 From: Oleg Nesterov To: "Paul E. McKenney" Cc: Alan Stern , Kernel development list Subject: Re: [patch] cpufreq: mark cpufreq_tsc() as core_initcall_sync Message-ID: <20061121210105.GA381@oleg> References: <20061119214315.GI4427@us.ibm.com> <20061121191338.GB2013@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061121191338.GB2013@us.ibm.com> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1459 Lines: 31 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/