public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	<linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] irq: Remove unnecessary warning with affinity_hint
Date: Wed, 8 Apr 2015 16:27:21 +0900	[thread overview]
Message-ID: <5524D859.6010107@jp.fujitsu.com> (raw)
In-Reply-To: <20150408062849.GA23925@gmail.com>

Hi,

On 2015-04-08 15:28, Ingo Molnar wrote:
> 
> * Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com> wrote:
> 
>> Hi,
>>
>> If you turn off a PCI device whose driver has set affinity_hint,
>> you will get warning message which does _not_ explain the reason
>> why it appeared from the user's point of view.
>>
>>   # echo 0 > /sys/bus/pci/slots/65/power
>>
>>   Apr 28 20:29:39 localhost kernel: ------------[ cut here ]------------
>>   Apr 28 20:29:39 localhost kernel: WARNING: at kernel/irq/manage.c:1002 __free_irq+0x22d/0x250() (Tainted: P           ---------------   )
>>   (snip)
>>
>> Users will misunderstand some problem has happened
>> even though he or she succeeded to turn off the device.
>> I suppose this warning was originally for a debug purpose
>> for driver developers and has incidentally been left.
>>
>> Just remove the warning is good and enough.
>>
>> Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
>>
>> --- a/kernel/irq/manage.c
>> +++ b/kernel/irq/manage.c
>> @@ -1335,7 +1335,7 @@ static struct irqaction *__free_irq(unsi
>>  
>>  #ifdef CONFIG_SMP
>>  	/* make sure affinity_hint is cleaned up */
>> -	if (WARN_ON_ONCE(desc->affinity_hint))
>> +	if (desc->affinity_hint)
>>  		desc->affinity_hint = NULL;
> 
> Well, drivers that are using irq_set_affinity_hint() are expected to 
> call:
> 
> 	irq_set_affinity_hint(irq, NULL);
> 
> to clear the affinity mask, before releasing the irq. This warning 
> flags drivers that forgot to do that and which might thus leak a 
> dynamically allocated CPU mask (and/or other resources).

Calling irq_set_affinity_hint(irq, NULL) does not guarantee that
the driver does not forget to deallocate a dynamically allocated
CPU mask and/or other resources. But if calling it with NULL 2nd-arg
before releasing the irq is a virtual rule of using irq_set_affinity_hint()
interface, I understand it.

> 
> Feel free to turn the warning message into a more informative WARN() 
> that will blame the driver that triggered it, if the stack dump into 
> the driver wasn't a clue enough ...

Still, I do not know leaving the warning message is effective to
prevent drivers from potentially leaking resource... considering
a kind of cost-effectivenss. Business users (not developers) hate
such kind of messages for developers.

Thanks,
Seiichi


  reply	other threads:[~2015-04-08  7:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 23:15 [PATCH] irq: Remove unnecessary warning with affinity_hint Seiichi Ikarashi
2015-04-08  4:47 ` Seiichi Ikarashi
2015-04-08  6:28   ` Ingo Molnar
2015-04-08  7:27     ` Seiichi Ikarashi [this message]
2015-04-08  7:39       ` Ingo Molnar
2015-04-08  7:59         ` Seiichi Ikarashi
  -- strict thread matches above, loose matches on Subject: below --
2015-03-25  0:55 Seiichi Ikarashi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5524D859.6010107@jp.fujitsu.com \
    --to=s.ikarashi@jp.fujitsu.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox