diff options
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6cbde310abed..f3d603cef2c0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2373,6 +2373,13 @@ void drain_all_pages(struct zone *zone) | |||
2373 | */ | 2373 | */ |
2374 | static cpumask_t cpus_with_pcps; | 2374 | static cpumask_t cpus_with_pcps; |
2375 | 2375 | ||
2376 | /* | ||
2377 | * Make sure nobody triggers this path before mm_percpu_wq is fully | ||
2378 | * initialized. | ||
2379 | */ | ||
2380 | if (WARN_ON_ONCE(!mm_percpu_wq)) | ||
2381 | return; | ||
2382 | |||
2376 | /* Workqueues cannot recurse */ | 2383 | /* Workqueues cannot recurse */ |
2377 | if (current->flags & PF_WQ_WORKER) | 2384 | if (current->flags & PF_WQ_WORKER) |
2378 | return; | 2385 | return; |
@@ -2422,7 +2429,7 @@ void drain_all_pages(struct zone *zone) | |||
2422 | for_each_cpu(cpu, &cpus_with_pcps) { | 2429 | for_each_cpu(cpu, &cpus_with_pcps) { |
2423 | struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu); | 2430 | struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu); |
2424 | INIT_WORK(work, drain_local_pages_wq); | 2431 | INIT_WORK(work, drain_local_pages_wq); |
2425 | schedule_work_on(cpu, work); | 2432 | queue_work_on(cpu, mm_percpu_wq, work); |
2426 | } | 2433 | } |
2427 | for_each_cpu(cpu, &cpus_with_pcps) | 2434 | for_each_cpu(cpu, &cpus_with_pcps) |
2428 | flush_work(per_cpu_ptr(&pcpu_drain, cpu)); | 2435 | flush_work(per_cpu_ptr(&pcpu_drain, cpu)); |
@@ -4519,13 +4526,13 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask) | |||
4519 | K(node_page_state(pgdat, NR_FILE_MAPPED)), | 4526 | K(node_page_state(pgdat, NR_FILE_MAPPED)), |
4520 | K(node_page_state(pgdat, NR_FILE_DIRTY)), | 4527 | K(node_page_state(pgdat, NR_FILE_DIRTY)), |
4521 | K(node_page_state(pgdat, NR_WRITEBACK)), | 4528 | K(node_page_state(pgdat, NR_WRITEBACK)), |
4529 | K(node_page_state(pgdat, NR_SHMEM)), | ||
4522 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 4530 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
4523 | K(node_page_state(pgdat, NR_SHMEM_THPS) * HPAGE_PMD_NR), | 4531 | K(node_page_state(pgdat, NR_SHMEM_THPS) * HPAGE_PMD_NR), |
4524 | K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED) | 4532 | K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED) |
4525 | * HPAGE_PMD_NR), | 4533 | * HPAGE_PMD_NR), |
4526 | K(node_page_state(pgdat, NR_ANON_THPS) * HPAGE_PMD_NR), | 4534 | K(node_page_state(pgdat, NR_ANON_THPS) * HPAGE_PMD_NR), |
4527 | #endif | 4535 | #endif |
4528 | K(node_page_state(pgdat, NR_SHMEM)), | ||
4529 | K(node_page_state(pgdat, NR_WRITEBACK_TEMP)), | 4536 | K(node_page_state(pgdat, NR_WRITEBACK_TEMP)), |
4530 | K(node_page_state(pgdat, NR_UNSTABLE_NFS)), | 4537 | K(node_page_state(pgdat, NR_UNSTABLE_NFS)), |
4531 | node_page_state(pgdat, NR_PAGES_SCANNED), | 4538 | node_page_state(pgdat, NR_PAGES_SCANNED), |