From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 2/2] mm: page allocator: Do not drain per-cpu lists via IPI from page allocator context Date: Thu, 12 Jan 2012 16:08:04 +0100 Message-ID: <1326380884.2442.187.camel@twins> References: <1326276668-19932-1-git-send-email-mgorman@suse.de> <1326276668-19932-3-git-send-email-mgorman@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Cc: Mel Gorman , Linux-MM , Linux-FSDevel , LKML , Andrew Morton , "Srivatsa S. Bhat" , Russell King - ARM Linux , "Paul E. McKenney" , Miklos Szeredi , "Eric W. Biederman" , Greg KH , Gong Chen To: Gilad Ben-Yossef Return-path: In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 2012-01-12 at 16:51 +0200, Gilad Ben-Yossef wrote: > What I can't figure out is why we don't need get/put_online_cpus() > pair around each and every call > to on_each_cpu everywhere? and if we do, perhaps making it a part of > on_each_cpu is the way to go? >=20 > Something like: >=20 > diff --git a/kernel/smp.c b/kernel/smp.c > index f66a1b2..cfa3882 100644 > --- a/kernel/smp.c > +++ b/kernel/smp.c > @@ -691,11 +691,15 @@ void on_each_cpu(void (*func) (void *info), void > *info, int wait) > { > unsigned long flags; >=20 > + BUG_ON(in_atomic()); > + > + get_online_cpus(); > preempt_disable(); Your preempt_disable() here serializes against hotplug.. > smp_call_function(func, info, wait); > local_irq_save(flags); > func(info); > local_irq_restore(flags); > preempt_enable(); > + put_online_cpus(); > } > EXPORT_SYMBOL(on_each_cpu);=20 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org