Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbdFTG6t (ORCPT ); Tue, 20 Jun 2017 02:58:49 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:41446 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdFTG6s (ORCPT ); Tue, 20 Jun 2017 02:58:48 -0400 Date: Tue, 20 Jun 2017 08:58:36 +0200 (CEST) From: Thomas Gleixner To: Dou Liyang cc: LKML , Marc Zyngier , Christoph Hellwig , Ingo Molnar , Peter Zijlstra , Michael Ellerman , Jens Axboe , Keith Busch Subject: Re: [patch 19/55] genirq: Provide irq_fixup_move_pending() In-Reply-To: Message-ID: References: <20170619233700.547167146@linutronix.de> <20170619235444.691345468@linutronix.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 37 On Tue, 20 Jun 2017, Dou Liyang wrote: > At 06/20/2017 07:37 AM, Thomas Gleixner wrote: > [...] > > > > +/** > > + * irq_fixup_move_pending - Cleanup irq move pending from a dying CPU > > + * @desc: Interrupt descpriptor to clean up > > + * @force_clear: If set clear the move pending bit unconditionally. > > + * If not set, clear it only when the dying CPU is the > > + * last one in the pending mask. > > + * > > + * Returns true if the pending bit was set and the pending mask contains an > > + * online CPU other than the dying CPU. > > + */ > > +bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear) > > +{ > > + struct irq_data *data = irq_desc_get_irq_data(desc); > > + > > + if (!irqd_is_setaffinity_pending(data)) > > + return false; > > + > > + /* > > + * The outgoing CPU might be the last online target in a pending > > + * interrupt move. If that's the case clear the pending move bit. > > + */ > > + if (cpumask_any_and(desc->pending_mask, cpu_online_mask) > nr_cpu_ids) > > { > > Should we consider the case of "=nr_cpu_ids" here, like: > > cpumask_any_and(desc->pending_mask, cpu_online_mask) >= nr_cpu_ids Yes, indeed. > is wrong. Good catch! Thanks, tglx