The sysfs file which reports memory was broken by the recent
update go wk45.
BUG=chromium-os:36060,chrome-os-partner:16814
TEST=Verified that the sysfs file now reports the correct data
localhost ~ # cat /sys/devices/platform/mali.0/memory
57143296 bytes
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/devices/platform/mali.0/memory
28672 bytes
localhost ~ # start ui
ui start/running, process 4791
localhost ~ # cat /sys/devices/platform/mali.0/memory
51875840 bytes
localhost ~ # stop ui
ui stop/waiting
localhost ~ # cat /sys/devices/platform/mali.0/memory
28672 bytes
Change-Id: I6df9bf70028ac0bc18fe993242c65dc87c430fd2
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39730
Reviewed-by: Anush Elangovan <anush@google.com>
#include <linux/mempool.h>
#include <linux/mm.h>
+atomic_t mali_memory_pages;
+
struct kbase_page_metadata
{
struct list_head list;
}
if (i == nr_pages)
- return MALI_ERROR_NONE;
+ goto out;
for (; i < nr_pages; i++)
{
pages[i] = PFN_PHYS(page_to_pfn(p));
}
+out:
+ atomic_add(nr_pages, &mali_memory_pages);
return MALI_ERROR_NONE;
+
err_out_roll_back:
while (i--)
{
}
}
+ atomic_sub(nr_pages, &mali_memory_pages);
+
mutex_lock(&allocator->free_list_lock);
list_splice(&new_free_list_items, &allocator->free_list_head);
atomic_add(page_count, &allocator->free_list_size);
*/
void kbase_free_phy_pages_helper(struct kbase_va_region * reg, u32 nr_pages);
+extern atomic_t mali_memory_pages;
#endif /* _KBASE_MEM_H_ */
}
};
-atomic_t mali_memory_pages;
-
/**
* Read the CPU clock speed
*/