Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750971AbdFTEWQ (ORCPT ); Tue, 20 Jun 2017 00:22:16 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:62457 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750772AbdFTEWP (ORCPT ); Tue, 20 Jun 2017 00:22:15 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20247254" Subject: Re: [patch 19/55] genirq: Provide irq_fixup_move_pending() To: Thomas Gleixner , LKML References: <20170619233700.547167146@linutronix.de> <20170619235444.691345468@linutronix.de> CC: Marc Zyngier , Christoph Hellwig , Ingo Molnar , Peter Zijlstra , Michael Ellerman , Jens Axboe , Keith Busch From: Dou Liyang Message-ID: Date: Tue, 20 Jun 2017 12:21:57 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170619235444.691345468@linutronix.de> Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 5CAC847C6108.AC2A0 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 48 Hi Thomas, 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 Thanks. Dou > + irqd_clr_move_pending(data); > + return false; > + } > + if (force_clear) > + irqd_clr_move_pending(data); > + return true; > +} > + > void irq_move_masked_irq(struct irq_data *idata) > { > struct irq_desc *desc = irq_data_to_desc(idata);