From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753703AbdCMUTV (ORCPT ); Mon, 13 Mar 2017 16:19:21 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:38776 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751934AbdCMUTO (ORCPT ); Mon, 13 Mar 2017 16:19:14 -0400 Date: Mon, 13 Mar 2017 21:19:10 +0100 (CET) From: Thomas Gleixner To: Sodagudi Prasad cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, will.deacon@arm.com, catalin.marinas@arm.com Subject: Re: Schedule affinity_notify work while migrating IRQs during hot plug In-Reply-To: <36fe90bcca0a9c6283c4012412ed2924@codeaurora.org> Message-ID: References: <05102c455476941d37904f8c6f387452@codeaurora.org> <36fe90bcca0a9c6283c4012412ed2924@codeaurora.org> 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 On Mon, 13 Mar 2017, Sodagudi Prasad wrote: > On 2017-02-27 09:21, Thomas Gleixner wrote: > > On Mon, 27 Feb 2017, Sodagudi Prasad wrote: > > > So I am thinking that, adding following sched_work() would notify clients. > > > > And break the world and some more. > > > > > diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c > > > index 6b66959..5e4766b 100644 > > > --- a/kernel/irq/manage.c > > > +++ b/kernel/irq/manage.c > > > @@ -207,6 +207,7 @@ int irq_do_set_affinity(struct irq_data *data, const > > > struct cpumask *mask, > > > case IRQ_SET_MASK_OK_DONE: > > > cpumask_copy(desc->irq_common_data.affinity, mask); > > > case IRQ_SET_MASK_OK_NOCOPY: > > > + schedule_work(&desc->affinity_notify->work); > > > irq_set_thread_affinity(desc); > > > ret = 0; > > > > You cannot do that unconditionally and just slap that schedule_work() call > > into the code. Aside of that schedule_work() would be invoked twice for all > > calls which come via irq_set_affinity_locked() .... > Hi Tglx, > > Yes. I agree with you, schedule_work() gets invoked twice with previous > change. > > How about calling irq_set_notify_locked() instead of irq_do_set_notify()? Is this a quiz? Can you actually see the difference between these functions? There is a damned good reason WHY this calls irq_do_set_affinity(). Thanks, tglx