]> git.baikalelectronics.ru Git - kernel.git/commit
cxl: Fix allocating a minimum of 2 pages for the SPA
authorIan Munsie <imunsie@au1.ibm.com>
Wed, 29 Jun 2016 12:16:26 +0000 (22:16 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 8 Jul 2016 12:10:44 +0000 (22:10 +1000)
commite32ba426b3d4bff494bab98f3e3aa14a9efb658d
treea64dfc31e0088296859c867bf3c9d2035599e095
parent961e37d26fa55c93bb8248e946a7d56ee80e23fb
cxl: Fix allocating a minimum of 2 pages for the SPA

The Scheduled Process Area is allocated dynamically with enough pages to
fit at least as many processes as the AFU descriptor indicated. Since
the calculation is non-trivial, it does this by calculating how many
processes could fit in an allocation of a given order, and increasing
that order until it can fit enough processes or hits the maximum
supported size.

Currently, it will start this search using a SPA of 2 pages instead of
1. This can waste a page of memory if the AFU's maximum number of
supported processes was small enough to fit in one page.

Fix the algorithm to start the search at 1 page.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/native.c