Files
android_kernel_xiaomi_sm8450/include/linux
KAMEZAWA Hiroyuki f0c0b2b808 change zonelist order: zonelist order selection logic
Make zonelist creation policy selectable from sysctl/boot option v6.

This patch makes NUMA's zonelist (of pgdat) order selectable.
Available order are Default(automatic)/ Node-based / Zone-based.

[Default Order]
The kernel selects Node-based or Zone-based order automatically.

[Node-based Order]
This policy treats the locality of memory as the most important parameter.
Zonelist order is created by each zone's locality. This means lower zones
(ex. ZONE_DMA) can be used before higher zone (ex. ZONE_NORMAL) exhausion.
IOW. ZONE_DMA will be in the middle of zonelist.
current 2.6.21 kernel uses this.

Pros.
 * A user can expect local memory as much as possible.
Cons.
 * lower zone will be exhansted before higher zone. This may cause OOM_KILL.

Maybe suitable if ZONE_DMA is relatively big and you never see OOM_KILL
because of ZONE_DMA exhaution and you need the best locality.

(example)
assume 2 node NUMA. node(0) has ZONE_DMA/ZONE_NORMAL, node(1) has ZONE_NORMAL.

*node(0)'s memory allocation order:

 node(0)'s NORMAL -> node(0)'s DMA -> node(1)'s NORMAL.

*node(1)'s memory allocation order:

 node(1)'s NORMAL -> node(0)'s NORMAL -> node(0)'s DMA.

[Zone-based order]
This policy treats the zone type as the most important parameter.
Zonelist order is created by zone-type order. This means lower zone
never be used bofere higher zone exhaustion.
IOW. ZONE_DMA will be always at the tail of zonelist.

Pros.
 * OOM_KILL(bacause of lower zone) occurs only if the whole zones are exhausted.
Cons.
 * memory locality may not be best.

(example)
assume 2 node NUMA. node(0) has ZONE_DMA/ZONE_NORMAL, node(1) has ZONE_NORMAL.

*node(0)'s memory allocation order:

 node(0)'s NORMAL -> node(1)'s NORMAL -> node(0)'s DMA.

*node(1)'s memory allocation order:

 node(1)'s NORMAL -> node(0)'s NORMAL -> node(0)'s DMA.

bootoption "numa_zonelist_order=" and proc/sysctl is supporetd.

command:
%echo N > /proc/sys/vm/numa_zonelist_order

Will rebuild zonelist in Node-based order.

command:
%echo Z > /proc/sys/vm/numa_zonelist_order

Will rebuild zonelist in Zone-based order.

Thanks to Lee Schermerhorn, he gives me much help and codes.

[Lee.Schermerhorn@hp.com: add check_highest_zone to build_zonelists_in_zone_order]
[akpm@linux-foundation.org: build fix]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "jesse.barnes@intel.com" <jesse.barnes@intel.com>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-16 09:05:35 -07:00
..
2006-09-26 17:40:24 -04:00
2007-07-12 15:41:24 -07:00
2007-05-01 16:11:57 +02:00
2007-06-16 13:16:16 -07:00
2006-12-04 02:00:22 -05:00
2007-07-13 08:06:14 -07:00
2006-12-02 21:22:55 -08:00
2006-12-02 21:22:55 -08:00
2007-05-11 05:38:26 -04:00
2007-02-20 17:10:15 -08:00
2006-12-08 08:28:39 -08:00
2006-12-07 08:39:20 -08:00
2007-05-07 12:12:55 -07:00
2006-12-08 08:28:39 -08:00
2007-05-23 20:14:12 -07:00
2007-01-30 08:26:45 -08:00
2007-02-20 17:10:14 -08:00
2007-05-08 11:15:15 -07:00
2007-05-09 12:30:56 -07:00
2007-05-07 12:13:00 -07:00
2007-05-21 09:56:57 -07:00
2007-05-10 18:24:13 +02:00
2007-05-08 11:15:25 -07:00
2006-12-07 08:39:25 -08:00
2007-05-08 11:15:26 -07:00
2007-07-09 08:22:54 +01:00
2007-07-09 08:23:17 +01:00
2007-02-09 17:39:36 -05:00
2007-07-11 16:09:00 -07:00
2007-02-11 11:18:07 -08:00
2007-07-12 10:55:56 -07:00
2007-05-07 12:12:58 -07:00
2007-06-01 08:18:29 -07:00
2007-03-27 09:05:15 -07:00
2007-05-09 08:57:56 +02:00
2007-05-31 16:20:15 -04:00
2007-05-31 16:20:14 -04:00
2006-03-31 12:18:54 -08:00
2007-05-06 20:38:28 -04:00
2006-09-22 15:18:47 -07:00
2007-07-10 08:04:15 +02:00
2006-12-07 08:39:32 -08:00
2007-06-18 09:48:41 -07:00
2006-10-02 07:57:12 -07:00
2007-07-10 00:35:17 -04:00
2007-07-09 18:51:58 +02:00
2007-04-28 11:01:07 -04:00
2007-03-16 00:59:29 -04:00
2006-03-26 08:56:56 -08:00
2007-04-07 10:03:43 -07:00
2007-05-11 16:56:02 +02:00
2006-12-10 21:21:29 +01:00
2007-07-09 23:17:58 +02:00
2007-07-16 09:05:34 -07:00
2007-07-10 22:15:03 -07:00
2007-07-14 18:55:06 -07:00
2007-04-25 22:24:41 -07:00
2007-04-25 22:29:10 -07:00
2006-09-28 18:02:29 -07:00
2007-05-11 08:29:36 -07:00
2007-05-11 08:29:34 -07:00
2007-05-15 08:54:00 -07:00
2006-10-10 15:37:22 -07:00
2006-12-02 21:21:21 -08:00
2006-12-07 08:39:47 -08:00
2006-12-07 08:39:47 -08:00
2006-12-07 08:39:47 -08:00
2006-10-04 00:31:09 -07:00
2007-07-10 22:16:44 -07:00
2007-05-08 11:15:09 -07:00
2006-06-21 12:40:49 -07:00
2006-12-08 08:28:57 -08:00
2006-11-30 05:24:39 +01:00
2007-04-25 22:25:52 -07:00
2007-06-08 17:23:34 -07:00
2007-05-09 12:30:53 -07:00
2007-07-10 22:15:26 -07:00
2007-05-03 10:52:32 +03:00
2007-07-10 21:30:33 -04:00
2006-07-31 15:44:29 -04:00
2007-05-18 20:46:30 -07:00
2007-07-16 09:05:34 -07:00
2006-06-05 12:29:17 -07:00
2007-05-08 11:15:18 -07:00
2007-05-09 12:30:49 -07:00
2007-05-03 10:52:22 +03:00
2007-06-21 15:55:12 -07:00
2006-11-30 04:40:22 +01:00
2006-09-28 18:02:22 -07:00
2007-01-23 00:34:54 -05:00
2007-07-10 17:33:05 +01:00
2006-03-23 07:38:14 -08:00
2007-07-14 18:55:06 -07:00
2007-05-09 12:30:54 -07:00
2006-08-27 11:01:32 -07:00
2007-05-04 17:59:07 -07:00
2007-05-07 12:12:59 -07:00
2007-05-08 11:15:05 -07:00
2007-05-08 11:15:05 -07:00
2007-05-05 14:15:32 -07:00
2007-03-12 16:31:50 -07:00
2006-03-27 08:44:48 -08:00
2007-05-08 11:15:14 -07:00
2007-04-17 16:36:26 -07:00
2007-05-08 11:14:57 -07:00
2006-12-04 02:00:36 -05:00
2006-10-03 23:01:26 +02:00
2007-01-11 18:18:21 -08:00
2007-05-07 12:12:54 -07:00
2007-05-09 08:57:56 +02:00
2006-06-25 10:01:06 -07:00
2006-06-25 10:01:06 -07:00
2006-09-26 08:49:04 -07:00
2007-06-07 13:39:34 -07:00
2007-05-17 05:23:06 -07:00
2006-06-25 10:01:14 -07:00
2007-05-08 11:15:18 -07:00
2007-07-09 18:52:01 +02:00
2007-05-07 12:12:50 -07:00
2007-05-11 08:29:36 -07:00
2007-05-11 08:29:36 -07:00
2007-06-24 08:59:12 -07:00
2007-06-16 13:16:16 -07:00
2007-02-20 17:10:14 -08:00
2007-05-21 21:47:27 -07:00
2007-05-08 11:14:58 -07:00
2007-05-08 11:15:18 -07:00
2006-10-01 00:39:18 -07:00
2007-05-09 12:30:57 -07:00
2007-02-11 10:51:18 -08:00
2007-02-20 17:10:13 -08:00
2007-05-11 08:29:34 -07:00
2006-11-30 05:32:19 +01:00
2007-05-08 11:15:18 -07:00
2007-05-11 08:29:36 -07:00
2007-02-16 08:13:56 -08:00
2006-03-31 12:18:56 -08:00
2006-12-02 21:21:08 -08:00
2006-09-28 17:53:59 -07:00
2007-05-11 08:29:35 -07:00
2007-05-11 08:29:35 -07:00
2006-03-23 07:38:14 -08:00
2007-05-03 00:55:34 -04:00
2006-12-15 08:47:51 -08:00
2007-05-07 12:12:58 -07:00
2007-07-12 16:34:40 -07:00
2006-10-01 00:39:19 -07:00
2007-05-09 12:30:56 -07:00
2007-07-09 18:52:01 +02:00
2007-05-21 09:18:19 -07:00
2007-02-11 11:18:05 -08:00
2007-05-04 12:55:39 -07:00