• Ian Munsie's avatar
    powerpc/msi: Improve IRQ bitmap allocator · b0345bbc
    Ian Munsie authored
    Currently msi_bitmap_alloc_hwirqs() will round up any IRQ allocation requests
    to the nearest power of 2. eg. ask for 5 IRQs and you'll get 8. This wastes a
    lot of IRQs which can be a scarce resource.
    
    For cxl we may require multiple IRQs for every context that is attached to the
    accelerator. There may be 1000s of contexts attached, hence we can easily run
    out of IRQs, especially if we are needlessly wasting them.
    
    This changes the msi_bitmap_alloc_hwirqs() to allocate only the required number
    of IRQs, hence avoiding this wastage. It keeps the natural alignment
    requirement though.
    Signed-off-by: default avatarIan Munsie <imunsie@au1.ibm.com>
    Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    b0345bbc
msi_bitmap.c 6.97 KB