Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768624Ab2KOSQW (ORCPT ); Thu, 15 Nov 2012 13:16:22 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:32504 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768557Ab2KOSQV (ORCPT ); Thu, 15 Nov 2012 13:16:21 -0500 X-Authority-Analysis: v=2.0 cv=NLdXCjGg c=1 sm=0 a=rXTBtCOcEpjy1lPqhTCpEQ==:17 a=mNMOxpOpBa8A:10 a=lD0sz97EK_QA:10 a=5SG0PmZfjMsA:10 a=Q9fys5e9bTEA:10 a=meVymXHHAAAA:8 a=CI89Ef65gYcA:10 a=w71J6GRbs94XdfFSZQ4A:9 a=PUjeQqilurYA:10 a=Z9CmttbFuPapjhzP:21 a=OyV9S9klgzkvoNl2:21 a=rXTBtCOcEpjy1lPqhTCpEQ==:117 X-Cloudmark-Score: 0 X-Originating-IP: 74.67.115.198 Message-ID: <1353003380.18025.110.camel@gandalf.local.home> Subject: Re: [PATCH RFC] irq_work: Flush work on CPU_DYING (was: Re: [PATCH 7/7] printk: Wake up klogd using irq_work) From: Steven Rostedt To: Frederic Weisbecker Cc: Ingo Molnar , LKML , Peter Zijlstra , Thomas Gleixner , Andrew Morton , Paul Gortmaker Date: Thu, 15 Nov 2012 13:16:20 -0500 In-Reply-To: <1353003204.18025.109.camel@gandalf.local.home> References: <1352925457-15700-1-git-send-email-fweisbec@gmail.com> <1352925457-15700-8-git-send-email-fweisbec@gmail.com> <1352953617.18025.94.camel@gandalf.local.home> <1352997261.18025.103.camel@gandalf.local.home> <1353003204.18025.109.camel@gandalf.local.home> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.4.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1942 Lines: 83 On Thu, 2012-11-15 at 13:13 -0500, Steven Rostedt wrote: > > + > > +/* > > + * Run the irq_work entries on this cpu. Requires to be ran from hardirq > > + * context with local IRQs disabled. > > + */ > > +void irq_work_run(void) > > +{ > > + BUG_ON(!in_irq()); > > + __irq_work_run(); > > +} > > EXPORT_SYMBOL_GPL(irq_work_run); > > #ifdef CONFIG_HOTPLUG_CPU > > > > +static void irq_work_run_cpu_down(void) > > +{ > > + __irq_work_run(); > > +} > #endif > > Or just move the function into the #ifdef that is below. Or even, just call __irq_work_run() directly. > > -- Steve > > > + > > /* > > * Synchronize against the irq_work @entry, ensures the entry is not > > * currently in use. > > @@ -169,3 +180,35 @@ void irq_work_sync(struct irq_work *work > > cpu_relax(); > > } > > EXPORT_SYMBOL_GPL(irq_work_sync); > > + > > +#ifdef CONFIG_HOTPLUG_CPU > > +static int irq_work_cpu_notify(struct notifier_block *self, > > + unsigned long action, void *hcpu) > > +{ > > + long cpu = (long)hcpu; > > + > > + switch (action) { > > + case CPU_DYING: > > + /* Called from stop_machine */ > > + if (WARN_ON_ONCE(cpu != smp_processor_id())) > > + break; > > + irq_work_run_cpu_down(); __irq_work_run(); -- Steve > > + break; > > + default: > > + break; > > + } > > + return NOTIFY_OK; > > +} > > + > > +static struct notifier_block cpu_notify; > > + > > +static __init int irq_work_init_cpu_notifier(void) > > +{ > > + cpu_notify.notifier_call = irq_work_cpu_notify; > > + cpu_notify.priority = 0; > > + register_cpu_notifier(&cpu_notify); > > + return 0; > > +} > > +device_initcall(irq_work_init_cpu_notifier); > > + > > +#endif /* CONFIG_HOTPLUG_CPU */ > > > -- 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/