diff options
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2c6d5f64feca..cba2a64792e6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -2583,30 +2583,23 @@ int __isolate_free_page(struct page *page, unsigned int order) | |||
| 2583 | * Update NUMA hit/miss statistics | 2583 | * Update NUMA hit/miss statistics |
| 2584 | * | 2584 | * |
| 2585 | * Must be called with interrupts disabled. | 2585 | * Must be called with interrupts disabled. |
| 2586 | * | ||
| 2587 | * When __GFP_OTHER_NODE is set assume the node of the preferred | ||
| 2588 | * zone is the local node. This is useful for daemons who allocate | ||
| 2589 | * memory on behalf of other processes. | ||
| 2590 | */ | 2586 | */ |
| 2591 | static inline void zone_statistics(struct zone *preferred_zone, struct zone *z, | 2587 | static inline void zone_statistics(struct zone *preferred_zone, struct zone *z, |
| 2592 | gfp_t flags) | 2588 | gfp_t flags) |
| 2593 | { | 2589 | { |
| 2594 | #ifdef CONFIG_NUMA | 2590 | #ifdef CONFIG_NUMA |
| 2595 | int local_nid = numa_node_id(); | ||
| 2596 | enum zone_stat_item local_stat = NUMA_LOCAL; | 2591 | enum zone_stat_item local_stat = NUMA_LOCAL; |
| 2597 | 2592 | ||
| 2598 | if (unlikely(flags & __GFP_OTHER_NODE)) { | 2593 | if (z->node != numa_node_id()) |
| 2599 | local_stat = NUMA_OTHER; | 2594 | local_stat = NUMA_OTHER; |
| 2600 | local_nid = preferred_zone->node; | ||
| 2601 | } | ||
| 2602 | 2595 | ||
| 2603 | if (z->node == local_nid) { | 2596 | if (z->node == preferred_zone->node) |
| 2604 | __inc_zone_state(z, NUMA_HIT); | 2597 | __inc_zone_state(z, NUMA_HIT); |
| 2605 | __inc_zone_state(z, local_stat); | 2598 | else { |
| 2606 | } else { | ||
| 2607 | __inc_zone_state(z, NUMA_MISS); | 2599 | __inc_zone_state(z, NUMA_MISS); |
| 2608 | __inc_zone_state(preferred_zone, NUMA_FOREIGN); | 2600 | __inc_zone_state(preferred_zone, NUMA_FOREIGN); |
| 2609 | } | 2601 | } |
| 2602 | __inc_zone_state(z, local_stat); | ||
| 2610 | #endif | 2603 | #endif |
| 2611 | } | 2604 | } |
| 2612 | 2605 | ||
