|
@@ -500,8 +500,12 @@ void refresh_cpu_vm_stats(int cpu)
|
|
* z = the zone from which the allocation occurred.
|
|
* z = the zone from which the allocation occurred.
|
|
*
|
|
*
|
|
* Must be called with interrupts disabled.
|
|
* Must be called with interrupts disabled.
|
|
|
|
+ *
|
|
|
|
+ * When __GFP_OTHER_NODE is set assume the node of the preferred
|
|
|
|
+ * zone is the local node. This is useful for daemons who allocate
|
|
|
|
+ * memory on behalf of other processes.
|
|
*/
|
|
*/
|
|
-void zone_statistics(struct zone *preferred_zone, struct zone *z)
|
|
|
|
|
|
+void zone_statistics(struct zone *preferred_zone, struct zone *z, gfp_t flags)
|
|
{
|
|
{
|
|
if (z->zone_pgdat == preferred_zone->zone_pgdat) {
|
|
if (z->zone_pgdat == preferred_zone->zone_pgdat) {
|
|
__inc_zone_state(z, NUMA_HIT);
|
|
__inc_zone_state(z, NUMA_HIT);
|
|
@@ -509,7 +513,8 @@ void zone_statistics(struct zone *preferred_zone, struct zone *z)
|
|
__inc_zone_state(z, NUMA_MISS);
|
|
__inc_zone_state(z, NUMA_MISS);
|
|
__inc_zone_state(preferred_zone, NUMA_FOREIGN);
|
|
__inc_zone_state(preferred_zone, NUMA_FOREIGN);
|
|
}
|
|
}
|
|
- if (z->node == numa_node_id())
|
|
|
|
|
|
+ if (z->node == ((flags & __GFP_OTHER_NODE) ?
|
|
|
|
+ preferred_zone->node : numa_node_id()))
|
|
__inc_zone_state(z, NUMA_LOCAL);
|
|
__inc_zone_state(z, NUMA_LOCAL);
|
|
else
|
|
else
|
|
__inc_zone_state(z, NUMA_OTHER);
|
|
__inc_zone_state(z, NUMA_OTHER);
|