From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932733AbbLBPJS (ORCPT ); Wed, 2 Dec 2015 10:09:18 -0500 Received: from casper.infradead.org ([85.118.1.10]:57884 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932425AbbLBPJP (ORCPT ); Wed, 2 Dec 2015 10:09:15 -0500 Date: Wed, 2 Dec 2015 16:09:08 +0100 From: Peter Zijlstra To: Frederic Weisbecker Cc: LKML , Chris Metcalf , Thomas Gleixner , Luiz Capitulino , Christoph Lameter , Ingo Molnar , Viresh Kumar , Rik van Riel Subject: Re: [PATCH 2/7] nohz: New tick dependency mask Message-ID: <20151202150908.GR3816@twins.programming.kicks-ass.net> References: <1447424529-13671-1-git-send-email-fweisbec@gmail.com> <1447424529-13671-3-git-send-email-fweisbec@gmail.com> <20151201204109.GN17308@twins.programming.kicks-ass.net> <20151201222025.GA31973@lerouge> <20151202105633.GQ3816@twins.programming.kicks-ass.net> <20151202140815.GB14766@lerouge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151202140815.GB14766@lerouge> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2015 at 03:08:16PM +0100, Frederic Weisbecker wrote: > On Wed, Dec 02, 2015 at 11:56:33AM +0100, Peter Zijlstra wrote: > > On Tue, Dec 01, 2015 at 11:20:28PM +0100, Frederic Weisbecker wrote: > > > > > + prev = fetch_or(dep, BIT_MASK(bit)); > > > > > + if (!prev) { > > > > > + /* > > > > > + * We need the IPIs to be sent from sane process context. > > > > > > > > Why ? > > > > > > Because posix timers code is all called with interrupts disabled and we can't > > > send IPIs then. > > > > > > > > > > > > + * The posix cpu timers are always set with irqs disabled. > > > > > + */ > > > > > + schedule_work(&kick_all_work); > > > > > + } > > > > > +} > > > > > + > > > > > +/* > > > > > + * Set a global tick dependency. Lets do the wide IPI kick asynchronously > > > > > + * for callers with irqs disabled. > > > > > > > > This seems to suggest you can call this with IRQs disabled > > > > > > Ah right, that's a misleading comment. We need to use the _delayed() version > > > when interrupts are disabled. > > > > Why can't you use tick_nohz_full_kick_cpu() for all that, which is > > usable from IRQ context and avoid all that delayed muck? > > Because I need to kick all the CPUs where the task/signal is running on. That's > a bit difficult to do though. I think we had something to try to send an IPI to a task, > but I can't retrieve it. Looks easy to do anyway. But in the signal case I'd need to do > that for all tasks in the group. That sounds like a costly loop. > > So I simplify that with a global IPI. Sure, but what I meant was that: for_each_cpu(cpu, mask) tick_nohz_full_kick_cpu(cpu); is IRQ safe, whereas the current thingy is not. Sure, its a wee bit less efficient, but do we really care?