From 2c45b9ceabce36f6873f227c09bedc2be9b3ca00 Mon Sep 17 00:00:00 2001 From: Kirill Artamonov Date: Mon, 30 Jan 2012 23:08:37 +0200 Subject: video: tegra: remove free memory check Used free memory check in allocation policy is not working, because it doesn't calculate available physical memory size in same way as android oom killer. It also breaks kernel build if swapping is enabled. Remove free memory check from allocation policy. Change-Id: I214d1829451f313dbace967e87ed4111e688865d Reviewed-on: http://git-master/r/85227 Reviewed-by: Simone Willett Tested-by: Simone Willett --- drivers/video/tegra/nvmap/nvmap_handle.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index 2f24ba515862..2e2b8b3d46a1 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -38,11 +38,8 @@ #include #include -#include -#include #include #include - #include "nvmap.h" #include "nvmap_mru.h" #include "nvmap_common.h" @@ -751,10 +748,6 @@ static const unsigned int heap_policy_large[] = { 0, }; -/* Do not override single page policy if there is not much space to -avoid invoking system oom killer. */ -#define NVMAP_SMALL_POLICY_SYSMEM_THRESHOLD 50000000 - int nvmap_alloc_handle_id(struct nvmap_client *client, unsigned long id, unsigned int heap_mask, size_t align, unsigned int flags) @@ -792,15 +785,7 @@ int nvmap_alloc_handle_id(struct nvmap_client *client, if (heap_mask & NVMAP_HEAP_IOVMM) heap_mask |= NVMAP_HEAP_SYSMEM; else if (heap_mask & NVMAP_HEAP_CARVEOUT_GENERIC) { - /* Calculate size of free physical pages - * managed by kernel */ - unsigned long freeMem = - (global_page_state(NR_FREE_PAGES) + - global_page_state(NR_FILE_PAGES) - - total_swapcache_pages) << PAGE_SHIFT; - - if (freeMem > NVMAP_SMALL_POLICY_SYSMEM_THRESHOLD) - heap_mask |= NVMAP_HEAP_SYSMEM; + heap_mask |= NVMAP_HEAP_SYSMEM; } } #endif -- cgit v1.2.3