base: Usable spe count
Use number of usable SPEs instead of number of physical SPEs
This patch modifies the mars_mpu_max() function so it uses # of usable
SPEs instead of # of physical SPEs in order to avoid allocating system
SPEs or NOSCHED SPEs to MARS.
Signed-off-by: Kazunori Asayama <asayama@sm.sony.co.jp>
Signed-off-by: Yuji Mano <yuji.mano@am.sony.com>
diff --git a/base/src/host/lib/mpu_cell.c b/base/src/host/lib/mpu_cell.c
index 66d8905..cff9233 100644
--- a/base/src/host/lib/mpu_cell.c
+++ b/base/src/host/lib/mpu_cell.c
@@ -64,7 +64,7 @@
* each node number is identical
* between numa API and libspe.
*/
- ret = spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, i);
+ ret = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, i);
if (ret < 0) {
num = ret;
break;
@@ -94,7 +94,7 @@
if (mars_numa_enabled())
*num = numa_mpu_max();
else
- *num = spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1);
+ *num = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, -1);
if (*num <= 0)
return MARS_ERROR_INTERNAL;