Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898AbbDHHdT (ORCPT ); Wed, 8 Apr 2015 03:33:19 -0400 Received: from mgwkm03.jp.fujitsu.com ([202.219.69.170]:36277 "EHLO mgwkm03.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbbDHHdQ (ORCPT ); Wed, 8 Apr 2015 03:33:16 -0400 Message-ID: <5524D859.6010107@jp.fujitsu.com> Date: Wed, 8 Apr 2015 16:27:21 +0900 From: Seiichi Ikarashi Organization: Fujitsu Limited User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Ingo Molnar CC: Thomas Gleixner , "Rafael J. Wysocki" , , Peter Zijlstra Subject: Re: [PATCH] irq: Remove unnecessary warning with affinity_hint References: <5519D929.8080700@jp.fujitsu.com> <5524B2C4.50009@jp.fujitsu.com> <20150408062849.GA23925@gmail.com> In-Reply-To: <20150408062849.GA23925@gmail.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2556 Lines: 70 Hi, On 2015-04-08 15:28, Ingo Molnar wrote: > > * Seiichi Ikarashi 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 >> >> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/