|
@@ -2373,6 +2373,13 @@ void drain_all_pages(struct zone *zone)
|
|
*/
|
|
*/
|
|
static cpumask_t cpus_with_pcps;
|
|
static cpumask_t cpus_with_pcps;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Make sure nobody triggers this path before mm_percpu_wq is fully
|
|
|
|
+ * initialized.
|
|
|
|
+ */
|
|
|
|
+ if (WARN_ON_ONCE(!mm_percpu_wq))
|
|
|
|
+ return;
|
|
|
|
+
|
|
/* Workqueues cannot recurse */
|
|
/* Workqueues cannot recurse */
|
|
if (current->flags & PF_WQ_WORKER)
|
|
if (current->flags & PF_WQ_WORKER)
|
|
return;
|
|
return;
|
|
@@ -2422,7 +2429,7 @@ void drain_all_pages(struct zone *zone)
|
|
for_each_cpu(cpu, &cpus_with_pcps) {
|
|
for_each_cpu(cpu, &cpus_with_pcps) {
|
|
struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu);
|
|
struct work_struct *work = per_cpu_ptr(&pcpu_drain, cpu);
|
|
INIT_WORK(work, drain_local_pages_wq);
|
|
INIT_WORK(work, drain_local_pages_wq);
|
|
- schedule_work_on(cpu, work);
|
|
|
|
|
|
+ queue_work_on(cpu, mm_percpu_wq, work);
|
|
}
|
|
}
|
|
for_each_cpu(cpu, &cpus_with_pcps)
|
|
for_each_cpu(cpu, &cpus_with_pcps)
|
|
flush_work(per_cpu_ptr(&pcpu_drain, cpu));
|
|
flush_work(per_cpu_ptr(&pcpu_drain, cpu));
|
|
@@ -4519,13 +4526,13 @@ void show_free_areas(unsigned int filter, nodemask_t *nodemask)
|
|
K(node_page_state(pgdat, NR_FILE_MAPPED)),
|
|
K(node_page_state(pgdat, NR_FILE_MAPPED)),
|
|
K(node_page_state(pgdat, NR_FILE_DIRTY)),
|
|
K(node_page_state(pgdat, NR_FILE_DIRTY)),
|
|
K(node_page_state(pgdat, NR_WRITEBACK)),
|
|
K(node_page_state(pgdat, NR_WRITEBACK)),
|
|
|
|
+ K(node_page_state(pgdat, NR_SHMEM)),
|
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
|
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
|
K(node_page_state(pgdat, NR_SHMEM_THPS) * HPAGE_PMD_NR),
|
|
K(node_page_state(pgdat, NR_SHMEM_THPS) * HPAGE_PMD_NR),
|
|
K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED)
|
|
K(node_page_state(pgdat, NR_SHMEM_PMDMAPPED)
|
|
* HPAGE_PMD_NR),
|
|
* HPAGE_PMD_NR),
|
|
K(node_page_state(pgdat, NR_ANON_THPS) * HPAGE_PMD_NR),
|
|
K(node_page_state(pgdat, NR_ANON_THPS) * HPAGE_PMD_NR),
|
|
#endif
|
|
#endif
|
|
- K(node_page_state(pgdat, NR_SHMEM)),
|
|
|
|
K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
|
|
K(node_page_state(pgdat, NR_WRITEBACK_TEMP)),
|
|
K(node_page_state(pgdat, NR_UNSTABLE_NFS)),
|
|
K(node_page_state(pgdat, NR_UNSTABLE_NFS)),
|
|
node_page_state(pgdat, NR_PAGES_SCANNED),
|
|
node_page_state(pgdat, NR_PAGES_SCANNED),
|