summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap/nvmap_handle.c
diff options
context:
space:
mode:
authorKirill Artamonov <kartamonov@nvidia.com>2012-01-30 23:08:37 +0200
committerSimone Willett <swillett@nvidia.com>2012-05-23 13:55:18 -0700
commit2c45b9ceabce36f6873f227c09bedc2be9b3ca00 (patch)
tree958554b462b2368f7850f837428c26da5e139841 /drivers/video/tegra/nvmap/nvmap_handle.c
parentc7e3189c1802c2a6552eec960f521a1891529892 (diff)
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 <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap_handle.c')
-rw-r--r--drivers/video/tegra/nvmap/nvmap_handle.c17
1 files changed, 1 insertions, 16 deletions
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 <mach/iovmm.h>
#include <linux/nvmap.h>
-#include <linux/vmstat.h>
-#include <linux/swap.h>
#include <linux/shrinker.h>
#include <linux/moduleparam.h>
-
#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