Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932406Ab1BWTKs (ORCPT ); Wed, 23 Feb 2011 14:10:48 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:37298 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007Ab1BWTKr (ORCPT ); Wed, 23 Feb 2011 14:10:47 -0500 Date: Wed, 23 Feb 2011 11:10:43 -0800 From: "Paul E. McKenney" To: Christoph Lameter Cc: Mathieu Desnoyers , Steven Rostedt , Frederic Weisbecker , linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, "Paul E. McKenney" Subject: Re: [PATCH RFC tip/core/rcu 11/11] rcu: move TREE_RCU from softirq to kthread Message-ID: <20110223191043.GU2163@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20110223013917.GA20996@linux.vnet.ibm.com> <1298425183-21265-11-git-send-email-paulmck@linux.vnet.ibm.com> <20110223161645.GA1819@nowhere> <1298479302.7666.94.camel@gandalf.stny.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1730 Lines: 52 On Wed, Feb 23, 2011 at 11:34:32AM -0600, Christoph Lameter wrote: > On Wed, 23 Feb 2011, Mathieu Desnoyers wrote: > > > > > > + > > > > > + local_irq_save(flags); > > > > > + cpu = smp_processor_id(); > > Drop this line. > > > > > > + if (per_cpu(rcu_cpu_kthread_task, cpu) == NULL) { > > use this_cpu_read(rcu_cpu_kthread_task) > > > > > > + local_irq_restore(flags); > > > > > + return; > > > > > + } > > > > > + per_cpu(rcu_cpu_has_work, cpu) = 1; > > this_cpu_write(rcu_cpu_has_work, 1); I have made these changes, thank you! These do introduce redundant preempt_disable()/preempt_enable() calls, but this is not on a fastpath, so should be OK, and the improved readability is certainly nice. The read and the write do need to happen on the same CPU, FWIW. > > This is not quite true on x86_64 and s390 anymore. __get_cpu_var() now > > uses a segment selector override to get the local CPU variable on x86. > > See x86's percpu.h for details. > > __get_cpu_var cannot use a segment override since there are places where > the address of the variable is taken. One needs to use this_cpu_ops for > that. Thanks for the info! Thanx, Paul > > > True, but we could also argue that the multiple checks for being preempt > > > can also be an issue. > > > > At least on x86 preemption don't actually need to be disabled: selection > > of the right per-cpu memory location is done atomically with the rest of > > the instruction by the segment selector. > > Right. -- 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/