• Thomas Gleixner's avatar
    x86/vector/msi: Switch to global reservation mode · 4900be83
    Thomas Gleixner authored
    Devices with many queues allocate a huge number of interrupts and get
    assigned a vector for each of them, even if the queues are not active and
    the interrupts never requested. This causes problems with the decision
    whether the global vector space is sufficient for CPU hot unplug
    operations.
    
    Change it to a reservation scheme, which allows overcommitment.
    
    When the interrupt is allocated and initialized the vector assignment
    merily updates the reservation request counter in the matrix
    allocator. This counter is used to emit warnings when the reservation
    exceeds the available vector space, but does not affect CPU offline
    operations. Like the managed interrupts the corresponding MSI/DMAR/IOAPIC
    entries are directed to the special shutdown vector.
    
    When the interrupt is requested, then the activation code tries to assign a
    real vector. If that succeeds the interrupt is started up and functional.
    
    If that fails, then subsequently request_irq() fails with -ENOSPC.
    
    This allows a clear separation of inactive and active modes and simplifies
    the final decisions whether the global vector space is sufficient for CPU
    offline operations.
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Tested-by: default avatarJuergen Gross <jgross@suse.com>
    Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
    Acked-by: default avatarJuergen Gross <jgross@suse.com>
    Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Marc Zyngier <marc.zyngier@arm.com>
    Cc: Alok Kataria <akataria@vmware.com>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Rui Zhang <rui.zhang@intel.com>
    Cc: "K. Y. Srinivasan" <kys@microsoft.com>
    Cc: Arjan van de Ven <arjan@linux.intel.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Len Brown <lenb@kernel.org>
    Link: https://lkml.kernel.org/r/20170913213156.184211133@linutronix.de
    4900be83
vector.c 29.3 KB