* [PATCH] x86: ioapic: Fix irq_free_descs count
@ 2014-06-30 15:31 Keith Busch
2014-06-30 21:57 ` David Rientjes
0 siblings, 1 reply; 4+ messages in thread
From: Keith Busch @ 2014-06-30 15:31 UTC (permalink / raw)
To: linux-kernel; +Cc: Keith Busch, Thomas Gleixner, x86
Signed-off-by: Keith Busch <keith.busch@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 7339e42..1487a12 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -455,9 +455,9 @@ EXPORT_SYMBOL_GPL(irq_alloc_hwirqs);
*/
void irq_free_hwirqs(unsigned int from, int cnt)
{
- int i;
+ int i, j;
- for (i = from; cnt > 0; i++, cnt--) {
+ for (i = from, j = cnt; j > 0; i++, j--) {
irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE);
arch_teardown_hwirq(i);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: ioapic: Fix irq_free_descs count
2014-06-30 15:31 [PATCH] x86: ioapic: Fix irq_free_descs count Keith Busch
@ 2014-06-30 21:57 ` David Rientjes
2014-06-30 22:15 ` Keith Busch
0 siblings, 1 reply; 4+ messages in thread
From: David Rientjes @ 2014-06-30 21:57 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-kernel, Thomas Gleixner, x86
On Mon, 30 Jun 2014, Keith Busch wrote:
> Signed-off-by: Keith Busch <keith.busch@intel.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: x86@kernel.org
Acked-by: David Rientjes <rientjes@google.com>
This is definitely a fix for "genirq: Provide generic hwirq allocation
facility", but the changelog doesn't describe what the problem is and the
title that this somehow fixes irq_free_descs() doesn't make any sense.
It's the equivalent of just doing
- irq_free_descs(from, cnt);
+ irq_free_descs(from, i - from);
I'd suggest the patch title be changed to
genirq: Fix memory leak when calling irq_free_hwirqs()
and the changelog state
irq_free_hwirqs() always calls irq_free_descs() with a cnt == 0 which
makes it a no-op since the interrupt count to free is decremented in
itself.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: ioapic: Fix irq_free_descs count
2014-06-30 21:57 ` David Rientjes
@ 2014-06-30 22:15 ` Keith Busch
2014-06-30 22:19 ` David Rientjes
0 siblings, 1 reply; 4+ messages in thread
From: Keith Busch @ 2014-06-30 22:15 UTC (permalink / raw)
To: David Rientjes; +Cc: Keith Busch, linux-kernel, Thomas Gleixner, x86
On Mon, 30 Jun 2014, David Rientjes wrote:
> On Mon, 30 Jun 2014, Keith Busch wrote:
>
>> Signed-off-by: Keith Busch <keith.busch@intel.com>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: x86@kernel.org
>
> Acked-by: David Rientjes <rientjes@google.com>
>
> This is definitely a fix for "genirq: Provide generic hwirq allocation
> facility", but the changelog doesn't describe what the problem is and the
> title that this somehow fixes irq_free_descs() doesn't make any sense.
My mistake, I used the component from the commit I bisected the bug
down to.
> It's the equivalent of just doing
>
> - irq_free_descs(from, cnt);
> + irq_free_descs(from, i - from);
>
> I'd suggest the patch title be changed to
>
> genirq: Fix memory leak when calling irq_free_hwirqs()
>
> and the changelog state
>
> irq_free_hwirqs() always calls irq_free_descs() with a cnt == 0 which
> makes it a no-op since the interrupt count to free is decremented in
> itself.
Yes, I like your suggestion. Should I submit a v2, or will maintainer
replace the changelog?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: ioapic: Fix irq_free_descs count
2014-06-30 22:15 ` Keith Busch
@ 2014-06-30 22:19 ` David Rientjes
0 siblings, 0 replies; 4+ messages in thread
From: David Rientjes @ 2014-06-30 22:19 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-kernel, Thomas Gleixner, x86
On Mon, 30 Jun 2014, Keith Busch wrote:
> On Mon, 30 Jun 2014, David Rientjes wrote:
> > On Mon, 30 Jun 2014, Keith Busch wrote:
> >
> > > Signed-off-by: Keith Busch <keith.busch@intel.com>
> > > Cc: Thomas Gleixner <tglx@linutronix.de>
> > > Cc: x86@kernel.org
> >
> > Acked-by: David Rientjes <rientjes@google.com>
> >
> > This is definitely a fix for "genirq: Provide generic hwirq allocation
> > facility", but the changelog doesn't describe what the problem is and the
> > title that this somehow fixes irq_free_descs() doesn't make any sense.
>
> My mistake, I used the component from the commit I bisected the bug
> down to.
>
> > It's the equivalent of just doing
> >
> > - irq_free_descs(from, cnt);
> > + irq_free_descs(from, i - from);
> >
> > I'd suggest the patch title be changed to
> >
> > genirq: Fix memory leak when calling irq_free_hwirqs()
> >
> > and the changelog state
> >
> > irq_free_hwirqs() always calls irq_free_descs() with a cnt == 0 which
> > makes it a no-op since the interrupt count to free is decremented in
> > itself.
>
> Yes, I like your suggestion. Should I submit a v2, or will maintainer
> replace the changelog?
>
It's an urgent patch since commit 7b6ef1262549 ("genirq: Provide generic
hwirq allocation facility") was already released in 3.15. Unless Thomas
fixes it up first, I'd reply with a v2 with the fixed title and changelog,
add a
Fixes: 7b6ef1262549f6afc5c881aaef80beb8fd15f908
tag along with my acked-by to make his life 0.000000001% easier.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-30 22:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30 15:31 [PATCH] x86: ioapic: Fix irq_free_descs count Keith Busch
2014-06-30 21:57 ` David Rientjes
2014-06-30 22:15 ` Keith Busch
2014-06-30 22:19 ` David Rientjes
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.