Code: Select all
**
* ps3_mm_region_create - create a memory region in the vas
* @r: pointer to a struct mem_region to accept initialized values
* @size: requested region size
*
* This implementation creates the region with the vas large page size.
* @size is rounded down to a multiple of the vas large page size.
*/
static int ps3_mm_region_create(struct mem_region *r, unsigned long size)
{
int result;
unsigned long muid;
r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M);
DBG("%s:%d requested %lxh\n", __func__, __LINE__, size);
DBG("%s:%d actual %lxh\n", __func__, __LINE__, r->size);
DBG("%s:%d difference %lxh (%luMB)\n", __func__, __LINE__,
(unsigned long)(size - r->size),
(size - r->size) / 1024 / 1024);
if (r->size == 0) {
DBG("%s:%d: size == 0\n", __func__, __LINE__);
result = -1;
goto zero_region;
}
result = lv1_allocate_memory(r->size, PAGE_SHIFT_16M, 0,
ALLOCATE_MEMORY_TRY_ALT_UNIT, &r->base, &muid);
....
result = lv1_allocate_memory( 6 * 1024 * 1024, 20,0,ALLOCATE_MEMORY_TRY_ALT_UNIT, &lpar, &muid);
ioremap ( and gpu_ioremap ) works for this lpar address.
So there are 6 free MiBs of memory, unused by Linux. Why?