From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbcGSDAh (ORCPT ); Mon, 18 Jul 2016 23:00:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58678 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752147AbcGSDAd (ORCPT ); Mon, 18 Jul 2016 23:00:33 -0400 X-IBM-Helo: d01dlp02.pok.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com Date: Mon, 18 Jul 2016 20:00:45 -0700 From: "Paul E. McKenney" To: Stephen Rothwell Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Anna-Maria Gleixner Subject: Re: linux-next: manual merge of the rcu tree with the tip tree Reply-To: paulmck@linux.vnet.ibm.com References: <20160718152628.312b3e43@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160718152628.312b3e43@canb.auug.org.au> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071903-0044-0000-0000-000000AF7C4C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071903-0045-0000-0000-000004C5A235 Message-Id: <20160719030045.GR7094@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-18_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607190032 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2016 at 03:26:28PM +1000, Stephen Rothwell wrote: > Hi Paul, > > Today's linux-next merge of the rcu tree got a conflict in: > > kernel/rcu/tree.c > > between commit: > > 4df8374254ea ("rcu: Convert rcutree to hotplug state machine") > > from the tip tree and commit: > > 2a84cde733b0 ("rcu: Exact CPU-online tracking for RCU") > > from the rcu tree. > > I fixed it up (see below) and can carry the fix as necessary. This > is now fixed as far as linux-next is concerned, but any non trivial > conflicts should be mentioned to your upstream maintainer when your tree > is submitted for merging. You may also want to consider cooperating > with the maintainer of the conflicting tree to minimise any particularly > complex conflicts. Ah, that is in -tip now? Easier to test, then! Thank you, the patch looks good at first glance, but will beat it up a bit. Thanx, Paul > -- > Cheers, > Stephen Rothwell > > diff --cc kernel/rcu/tree.c > index e5164deb51e1,5663d1e899d3..000000000000 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@@ -3812,54 -3809,34 +3809,80 @@@ int rcutree_prepare_cpu(unsigned int cp > > for_each_rcu_flavor(rsp) > rcu_init_percpu_data(cpu, rsp); > + > + rcu_prepare_kthreads(cpu); > + rcu_spawn_all_nocb_kthreads(cpu); > + > + return 0; > +} > + > +static void rcutree_affinity_setting(unsigned int cpu, int outgoing) > +{ > + struct rcu_data *rdp = per_cpu_ptr(rcu_state_p->rda, cpu); > + > + rcu_boost_kthread_setaffinity(rdp->mynode, outgoing); > +} > + > +int rcutree_online_cpu(unsigned int cpu) > +{ > + sync_sched_exp_online_cleanup(cpu); > + rcutree_affinity_setting(cpu, -1); > + return 0; > +} > + > +int rcutree_offline_cpu(unsigned int cpu) > +{ > + rcutree_affinity_setting(cpu, cpu); > + return 0; > +} > + > + > +int rcutree_dying_cpu(unsigned int cpu) > +{ > + struct rcu_state *rsp; > + > + for_each_rcu_flavor(rsp) > + rcu_cleanup_dying_cpu(rsp); > + return 0; > +} > + > +int rcutree_dead_cpu(unsigned int cpu) > +{ > + struct rcu_state *rsp; > + > + for_each_rcu_flavor(rsp) { > + rcu_cleanup_dead_cpu(cpu, rsp); > + do_nocb_deferred_wakeup(per_cpu_ptr(rsp->rda, cpu)); > + } > + return 0; > } > > + /* > + * Mark the specified CPU as being online so that subsequent grace periods > + * (both expedited and normal) will wait on it. Note that this means that > + * incoming CPUs are not allowed to use RCU read-side critical sections > + * until this function is called. Failing to observe this restriction > + * will result in lockdep splats. > + */ > + void rcu_cpu_starting(unsigned int cpu) > + { > + unsigned long flags; > + unsigned long mask; > + struct rcu_data *rdp; > + struct rcu_node *rnp; > + struct rcu_state *rsp; > + > + for_each_rcu_flavor(rsp) { > + rdp = this_cpu_ptr(rsp->rda); > + rnp = rdp->mynode; > + mask = rdp->grpmask; > + raw_spin_lock_irqsave_rcu_node(rnp, flags); > + rnp->qsmaskinitnext |= mask; > + rnp->expmaskinitnext |= mask; > + raw_spin_unlock_irqrestore_rcu_node(rnp, flags); > + } > + } > + > #ifdef CONFIG_HOTPLUG_CPU > /* > * The CPU is exiting the idle loop into the arch_cpu_idle_dead() > @@@ -4208,9 -4231,12 +4231,11 @@@ void __init rcu_init(void > * this is called early in boot, before either interrupts > * or the scheduler are operational. > */ > - cpu_notifier(rcu_cpu_notify, 0); > pm_notifier(rcu_pm_notify, 0); > - for_each_online_cpu(cpu) > + for_each_online_cpu(cpu) { > - rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)cpu); > + rcutree_prepare_cpu(cpu); > + rcu_cpu_starting(cpu); > + } > } > > #include "tree_exp.h" >