mirror of
https://github.com/gatieme/LDD-LinuxDeviceDrivers.git
synced 2026-11-08 02:37:38 +08:00
内存管理之内存初始化内存管理...
This commit is contained in:
1 parent
928c788ce1
commit
2e07cd7dc2
7 files changed
+252
-21
No files matched your search
@@ -6,7 +6,7 @@ GITHUB_COMMIT := $(COMMIT)
|
||||
|
||||
|
||||
ifeq ($(COMMIT), )
|
||||
GITHUB_COMMIT="更新了内存管理的目录结构..."
|
||||
GITHUB_COMMIT="内存管理之内存初始化内存管理..."
|
||||
endif
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,44 @@
|
||||
#ifdef CONFIG_NUMA
|
||||
/* The value user specified ....changed by config */
|
||||
static int user_zonelist_order = ZONELIST_ORDER_DEFAULT;
|
||||
/* string for sysctl */
|
||||
#define NUMA_ZONELIST_ORDER_LEN 16
|
||||
char numa_zonelist_order[16] = "default";
|
||||
|
||||
/*
|
||||
* interface for configure zonelist ordering.
|
||||
* command line option "numa_zonelist_order"
|
||||
* = "[dD]efault - default, automatic configuration.
|
||||
* = "[nN]ode - order by node locality, then by zone within node
|
||||
* = "[zZ]one - order by zone, then by locality within zone
|
||||
*/
|
||||
|
||||
static int __parse_numa_zonelist_order(char *s)
|
||||
{
|
||||
if (*s == 'd' || *s == 'D') {
|
||||
user_zonelist_order = ZONELIST_ORDER_DEFAULT;
|
||||
} else if (*s == 'n' || *s == 'N') {
|
||||
user_zonelist_order = ZONELIST_ORDER_NODE;
|
||||
} else if (*s == 'z' || *s == 'Z') {
|
||||
user_zonelist_order = ZONELIST_ORDER_ZONE;
|
||||
} else {
|
||||
pr_warn("Ignoring invalid numa_zonelist_order value: %s\n", s);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __init int setup_numa_zonelist_order(char *s)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!s)
|
||||
return 0;
|
||||
|
||||
ret = __parse_numa_zonelist_order(s);
|
||||
if (ret == 0)
|
||||
strlcpy(numa_zonelist_order, s, NUMA_ZONELIST_ORDER_LEN);
|
||||
|
||||
return ret;
|
||||
}
|
||||
early_param("numa_zonelist_order", setup_numa_zonelist_order);
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Reference in new issue
Block a user