powerpc/msi: Improve IRQ bitmap allocator
authorIan Munsie <imunsie@au1.ibm.com>
Wed, 8 Oct 2014 08:54:53 +0000 (19:54 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 8 Oct 2014 09:15:42 +0000 (20:15 +1100)
commitb0345bbc6d0980e63b9730b487d4f4ccb8e5cd12
tree82aba747d4a0c8161378f43caafb2b35ad6537bc
parentbe3ebfe8215392b714349554c5138b8b6592fe20
powerpc/msi: Improve IRQ bitmap allocator

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: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/sysdev/msi_bitmap.c
This page took 0.024335 seconds and 5 git commands to generate.