Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756143Ab0BBOgC (ORCPT ); Tue, 2 Feb 2010 09:36:02 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:38858 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477Ab0BBOgA (ORCPT ); Tue, 2 Feb 2010 09:36:00 -0500 Subject: Re: [PATCH] hrtimer, softirq: Fix hrtimer->softirq trampoline From: Peter Zijlstra To: Yury Polyanskiy Cc: Herbert Xu , Wei Yongjun , "netdev@vger.kernel.org" , "David S. Miller" , polyanskiy@gmail.com, Thomas Gleixner , lkml In-Reply-To: <20100202092814.064a89c0@penta.localdomain> References: <4B66A670.70503@cn.fujitsu.com> <20100202074914.GD11081@gondor.apana.org.au> <20100202085117.7a5c3530@penta.localdomain> <1265120401.24455.306.camel@laptop> <20100202092814.064a89c0@penta.localdomain> Content-Type: text/plain; charset="UTF-8" Date: Tue, 02 Feb 2010 15:35:50 +0100 Message-ID: <1265121350.24455.309.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 34 On Tue, 2010-02-02 at 09:28 -0500, Yury Polyanskiy wrote: > On Tue, 02 Feb 2010 15:20:01 +0100 > Peter Zijlstra wrote: > > static enum hrtimer_restart __hrtimer_tasklet_trampoline(struct hrtimer *timer) > > { > > struct tasklet_hrtimer *ttimer = > > container_of(timer, struct tasklet_hrtimer, timer); > > > > - if (hrtimer_is_hres_active(timer)) { > > - tasklet_hi_schedule(&ttimer->tasklet); > > - return HRTIMER_NORESTART; > > - } > > - return ttimer->function(timer); > > + tasklet_hi_schedule(&ttimer->tasklet); > > + return HRTIMER_NORESTART; > > } > > > > Are you totally against if(in_irq())? Yeah, things like that are an indication that you really don't know wtf you're doing and are just patching up. There is a single site where hrtimer callbacks can indeed be done from softirq, but in that case the above still works correctly, and I've been meaning to get rid of that anyway. -- 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/