Revert "ANDROID: add extra free kbytes tunable"
This reverts commit 92501cb670.
Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I31d831dad0716381b1e477f1f11c758135a5fde5
This commit is contained in:
@@ -109,7 +109,6 @@
|
||||
#if defined(CONFIG_SYSCTL)
|
||||
|
||||
/* External variables not in a header file. */
|
||||
extern int extra_free_kbytes;
|
||||
|
||||
/* Constants used for minimum and maximum */
|
||||
#ifdef CONFIG_LOCKUP_DETECTOR
|
||||
@@ -2923,14 +2922,6 @@ static struct ctl_table vm_table[] = {
|
||||
.extra1 = SYSCTL_ONE,
|
||||
.extra2 = &one_thousand,
|
||||
},
|
||||
{
|
||||
.procname = "extra_free_kbytes",
|
||||
.data = &extra_free_kbytes,
|
||||
.maxlen = sizeof(extra_free_kbytes),
|
||||
.mode = 0644,
|
||||
.proc_handler = min_free_kbytes_sysctl_handler,
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
},
|
||||
{
|
||||
.procname = "percpu_pagelist_high_fraction",
|
||||
.data = &percpu_pagelist_high_fraction,
|
||||
|
||||
@@ -336,23 +336,11 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Try to keep at least this much lowmem free. Do not allow normal
|
||||
* allocations below this point, only high priority ones. Automatically
|
||||
* tuned according to the amount of memory in the system.
|
||||
*/
|
||||
int min_free_kbytes = 1024;
|
||||
int user_min_free_kbytes = -1;
|
||||
int watermark_boost_factor __read_mostly = 15000;
|
||||
int watermark_scale_factor = 10;
|
||||
|
||||
/*
|
||||
* Extra memory for the system to try freeing. Used to temporarily
|
||||
* free memory, to make space for new workloads. Anyone can allocate
|
||||
* down to the min watermarks controlled by min_free_kbytes above.
|
||||
*/
|
||||
int extra_free_kbytes = 0;
|
||||
|
||||
static unsigned long nr_kernel_pages __initdata;
|
||||
static unsigned long nr_all_pages __initdata;
|
||||
static unsigned long dma_reserve __initdata;
|
||||
@@ -8356,7 +8344,6 @@ static void setup_per_zone_lowmem_reserve(void)
|
||||
static void __setup_per_zone_wmarks(void)
|
||||
{
|
||||
unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
|
||||
unsigned long pages_low = extra_free_kbytes >> (PAGE_SHIFT - 10);
|
||||
unsigned long lowmem_pages = 0;
|
||||
struct zone *zone;
|
||||
unsigned long flags;
|
||||
@@ -8368,13 +8355,11 @@ static void __setup_per_zone_wmarks(void)
|
||||
}
|
||||
|
||||
for_each_zone(zone) {
|
||||
u64 tmp, low;
|
||||
u64 tmp;
|
||||
|
||||
spin_lock_irqsave(&zone->lock, flags);
|
||||
tmp = (u64)pages_min * zone_managed_pages(zone);
|
||||
do_div(tmp, lowmem_pages);
|
||||
low = (u64)pages_low * zone_managed_pages(zone);
|
||||
do_div(low, vm_total_pages);
|
||||
if (is_highmem(zone)) {
|
||||
/*
|
||||
* __GFP_HIGH and PF_MEMALLOC allocations usually don't
|
||||
@@ -8408,8 +8393,8 @@ static void __setup_per_zone_wmarks(void)
|
||||
watermark_scale_factor, 10000));
|
||||
|
||||
zone->watermark_boost = 0;
|
||||
zone->_watermark[WMARK_LOW] = min_wmark_pages(zone) + low + tmp;
|
||||
zone->_watermark[WMARK_HIGH] = min_wmark_pages(zone) + low + tmp * 2;
|
||||
zone->_watermark[WMARK_LOW] = min_wmark_pages(zone) + tmp;
|
||||
zone->_watermark[WMARK_HIGH] = min_wmark_pages(zone) + tmp * 2;
|
||||
|
||||
spin_unlock_irqrestore(&zone->lock, flags);
|
||||
}
|
||||
@@ -8502,7 +8487,7 @@ postcore_initcall(init_per_zone_wmark_min)
|
||||
/*
|
||||
* min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so
|
||||
* that we can call two helper functions whenever min_free_kbytes
|
||||
* or extra_free_kbytes changes.
|
||||
* changes.
|
||||
*/
|
||||
int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write,
|
||||
void *buffer, size_t *length, loff_t *ppos)
|
||||
|
||||
Reference in New Issue
Block a user