Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603192

Re: Schedule affinity_notify work while migrating IRQs during hot plug

From Sodagudi Prasad <psodagud@codeaurora.org>
Newsgroups linux.kernel
Subject Re: Schedule affinity_notify work while migrating IRQs during hot plug
Date 2017-03-17 12:00 +0100
Message-ID <tlXLX-5a1-3@gated-at.bofh.it> (permalink)
References <tdpHr-7P4-11@gated-at.bofh.it> <tfxhv-jQ-1@gated-at.bofh.it> <tfxUf-Oq-19@gated-at.bofh.it> <tkE8G-5gy-23@gated-at.bofh.it> <tkEBH-5Mm-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 2017-03-13 13:19, Thomas Gleixner wrote:
> 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().
Other option is that, adding an argument to irq_do_set_affinity() and 
queue
work to notify when that new parameter set.  I have attached patch for 
the same.

I tested this change on arm64 bit platform and observed that clients 
drivers
are getting notified during cpu hot plug.

> Thanks,
> 
> 	tglx

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Schedule affinity_notify work while migrating IRQs during hot  plug Sodagudi Prasad <psodagud@codeaurora.org> - 2017-03-17 12:00 +0100
  Re: Schedule affinity_notify work while migrating IRQs during hot  plug Thomas Gleixner <tglx@linutronix.de> - 2017-03-17 14:20 +0100
    [PATCH] genirq: Notify clients whenever there is change in affinity Prasad Sodagudi <psodagud@codeaurora.org> - 2017-03-20 17:40 +0100
      Re: [PATCH] genirq: Notify clients whenever there is change in  affinity kbuild test robot <lkp@intel.com> - 2017-03-23 03:40 +0100
      Re: [PATCH] genirq: Notify clients whenever there is change in  affinity kbuild test robot <lkp@intel.com> - 2017-03-23 08:50 +0100
    Schedule affinity_notify work while migrating IRQs during hot plug Prasad Sodagudi <psodagud@codeaurora.org> - 2017-03-20 17:40 +0100

csiph-web