[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1413430551-22392-2-git-send-email-zhuhui@xiaomi.com>
Date: Thu, 16 Oct 2014 11:35:48 +0800
From: Hui Zhu <zhuhui@...omi.com>
To: <rjw@...ysocki.net>, <len.brown@...el.com>, <pavel@....cz>,
<m.szyprowski@...sung.com>, <akpm@...ux-foundation.org>,
<mina86@...a86.com>, <aneesh.kumar@...ux.vnet.ibm.com>,
<iamjoonsoo.kim@....com>, <hannes@...xchg.org>, <riel@...hat.com>,
<mgorman@...e.de>, <minchan@...nel.org>, <nasa4836@...il.com>,
<ddstreet@...e.org>, <hughd@...gle.com>, <mingo@...nel.org>,
<rientjes@...gle.com>, <peterz@...radead.org>,
<keescook@...omium.org>, <atomlin@...hat.com>, <raistlin@...ux.it>,
<axboe@...com>, <paulmck@...ux.vnet.ibm.com>,
<kirill.shutemov@...ux.intel.com>, <n-horiguchi@...jp.nec.com>,
<k.khlebnikov@...sung.com>, <msalter@...hat.com>, <deller@....de>,
<tangchen@...fujitsu.com>, <ben@...adent.org.uk>,
<akinobu.mita@...il.com>, <lauraa@...eaurora.org>,
<vbabka@...e.cz>, <sasha.levin@...cle.com>,
<vdavydov@...allels.com>, <suleiman@...gle.com>
CC: <linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<linux-mm@...ck.org>, Hui Zhu <zhuhui@...omi.com>
Subject: [PATCH 1/4] (CMA_AGGRESSIVE) Add CMA_AGGRESSIVE to Kconfig
Add CMA_AGGRESSIVE config that depend on CMA to Linux kernel config.
Add CMA_AGGRESSIVE_PHY_MAX, CMA_AGGRESSIVE_FREE_MIN and CMA_AGGRESSIVE_SHRINK
that depend on CMA_AGGRESSIVE.
If physical memory size (not include CMA memory) in byte less than or equal to
CMA_AGGRESSIVE_PHY_MAX, CMA aggressive switch (sysctl vm.cma-aggressive-switch)
will be opened.
When system boot, this value will set to sysctl "vm.cma-aggressive-free-min".
If this value is true, sysctl "vm.cma-aggressive-shrink-switch" will be set to
true when Linux boot.
Signed-off-by: Hui Zhu <zhuhui@...omi.com>
---
mm/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/mm/Kconfig b/mm/Kconfig
index 1d1ae6b..940f5f3 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -527,6 +527,49 @@ config CMA_AREAS
If unsure, leave the default value "7".
+config CMA_AGGRESSIVE
+ bool "CMA aggressive"
+ depends on CMA
+ default n
+ help
+ Be more aggressive about taking memory from CMA when allocate MOVABLE
+ page.
+ Sysctl "vm.cma-aggressive-switch", "vm.cma-aggressive-alloc-max"
+ and "vm.cma-aggressive-shrink-switch" can control this function.
+ If unsure, say "n".
+
+config CMA_AGGRESSIVE_PHY_MAX
+ hex "Physical memory size in Bytes that auto turn on the CMA aggressive switch"
+ depends on CMA_AGGRESSIVE
+ default 0x40000000
+ help
+ If physical memory size (not include CMA memory) in byte less than or
+ equal to this value, CMA aggressive switch will be opened.
+ After the Linux boot, sysctl "vm.cma-aggressive-switch" can control
+ the CMA AGGRESSIVE switch.
+
+config CMA_AGGRESSIVE_FREE_MIN
+ int "The minimum free CMA page number that CMA aggressive work"
+ depends on CMA_AGGRESSIVE
+ default 500
+ help
+ When system boot, this value will set to sysctl
+ "vm.cma-aggressive-free-min".
+ If the number of CMA free pages is small than this sysctl value,
+ CMA aggressive will not work.
+
+config CMA_AGGRESSIVE_SHRINK
+ bool "CMA aggressive shrink"
+ depends on CMA_AGGRESSIVE
+ default y
+ help
+ If this value is true, sysctl "vm.cma-aggressive-shrink-switch" will
+ be set to true when Linux boot.
+ If sysctl "vm.cma-aggressive-shrink-switch" is true and free normal
+ memory's size is smaller than the size that it want to allocate,
+ do memory shrink before driver allocate pages from CMA.
+ If unsure, say "y".
+
config MEM_SOFT_DIRTY
bool "Track memory changes"
depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY && PROC_FS
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists