linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] x86/apic: Avoid cm->allocated going negative in irq_matrix
@ 2021-02-19 11:30 Vitaly Kuznetsov
  2021-02-19 11:31 ` [PATCH RFC 1/2] x86/apic: Do not make an exception for PIC_CASCADE_IR when marking legacy irqs " Vitaly Kuznetsov
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Vitaly Kuznetsov @ 2021-02-19 11:30 UTC (permalink / raw)
  To: Thomas Gleixner, x86
  Cc: Ingo Molnar, Borislav Petkov, H. Peter Anvin, linux-kernel

I discovered that CPU0 offlining/onlining works only once:

     # echo 0 > /sys/devices/system/cpu/cpu0/online
     # echo 1 > /sys/devices/system/cpu/cpu0/online
     # echo 0 > /sys/devices/system/cpu/cpu0/online
     -bash: echo: write error: No space left on device
    
    with the following in dmesg:
    
     [ ... ] CPU 0 has 4294967295 vectors, 589 available. Cannot disable CPU

And the problem seems to be that irq_matrix_assign()/irq_matrix_free() calls
for PIC_CASCADE_IR are unbalanced, making cm->allocated go negative.

RFC as I didn't quite get why we're making an exception for PIC_CASCADE_IR in
the first place. Surely it is special, but for the sake of consistency we'd
better not treat it as such. Or maybe I just misunderstood everythin.

Vitaly Kuznetsov (2):
  x86/apic: Do not make an exception for PIC_CASCADE_IR when marking
    legacy irqs in irq_matrix
  genirq/matrix: WARN_ON_ONCE() when cm->allocated/m->total_allocated go
    negative

 arch/x86/kernel/apic/vector.c |  3 +--
 kernel/irq/matrix.c           | 11 +++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-19 10:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 11:30 [PATCH RFC 0/2] x86/apic: Avoid cm->allocated going negative in irq_matrix Vitaly Kuznetsov
2021-02-19 11:31 ` [PATCH RFC 1/2] x86/apic: Do not make an exception for PIC_CASCADE_IR when marking legacy irqs " Vitaly Kuznetsov
2021-03-17 20:14   ` Thomas Gleixner
2021-03-17 21:18     ` Thomas Gleixner
2021-03-17 21:40       ` Thomas Gleixner
2021-03-17 22:52         ` Thomas Gleixner
2021-03-18  8:47           ` Vitaly Kuznetsov
2021-03-18  8:29     ` Vitaly Kuznetsov
2021-03-18 10:10       ` Thomas Gleixner
2021-02-19 11:31 ` [PATCH RFC 2/2] genirq/matrix: WARN_ON_ONCE() when cm->allocated/m->total_allocated go negative Vitaly Kuznetsov
2021-03-17 20:38   ` Thomas Gleixner
2021-03-18  7:58     ` Vitaly Kuznetsov
2021-03-18 19:29       ` Thomas Gleixner
2021-03-19  9:59         ` Vitaly Kuznetsov
2021-03-11 10:19 ` [PATCH RFC 0/2] x86/apic: Avoid cm->allocated going negative in irq_matrix Vitaly Kuznetsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).