ANDROID: make cma_sysfs experimental

Since it's not stable until it could be merged into Linus's tree
lets make it as experimental. If a vendor want to use it, they
should carry on cma_sysfs.experimental=Y on kernel parameter.
Otherwise, it will be disabled.
If some vendor enables it, it means they know this is experimental
faeture so Android never guarantee it in the future.

Bug: 179256052
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: Ic6566197a7865dfcab6964d008103d3686c9d14b
This commit is contained in:
Minchan Kim 2021-03-24 16:24:08 -07:00 committed by Alistair Delva
parent a590359259
commit 2cf6f07bf0

View File

@ -8,9 +8,12 @@
#include <linux/cma.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include "cma.h"
static bool experimental;
#define CMA_ATTR_RO(_name) \
static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
@ -77,6 +80,9 @@ static int __init cma_sysfs_init(void)
struct cma *cma;
int i, err;
if (!experimental)
return 0;
cma_kobj_root = kobject_create_and_add("cma", mm_kobj);
if (!cma_kobj_root)
return -ENOMEM;
@ -110,3 +116,5 @@ static int __init cma_sysfs_init(void)
return err;
}
subsys_initcall(cma_sysfs_init);
module_param(experimental, bool, 0400);