vmstat.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  1. /*
  2. * linux/mm/vmstat.c
  3. *
  4. * Manages VM statistics
  5. * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
  6. *
  7. * zoned VM statistics
  8. * Copyright (C) 2006 Silicon Graphics, Inc.,
  9. * Christoph Lameter <christoph@lameter.com>
  10. */
  11. #include <linux/mm.h>
  12. #include <linux/module.h>
  13. #include <linux/cpu.h>
  14. void __get_zone_counts(unsigned long *active, unsigned long *inactive,
  15. unsigned long *free, struct pglist_data *pgdat)
  16. {
  17. struct zone *zones = pgdat->node_zones;
  18. int i;
  19. *active = 0;
  20. *inactive = 0;
  21. *free = 0;
  22. for (i = 0; i < MAX_NR_ZONES; i++) {
  23. *active += zones[i].nr_active;
  24. *inactive += zones[i].nr_inactive;
  25. *free += zones[i].free_pages;
  26. }
  27. }
  28. void get_zone_counts(unsigned long *active,
  29. unsigned long *inactive, unsigned long *free)
  30. {
  31. struct pglist_data *pgdat;
  32. *active = 0;
  33. *inactive = 0;
  34. *free = 0;
  35. for_each_online_pgdat(pgdat) {
  36. unsigned long l, m, n;
  37. __get_zone_counts(&l, &m, &n, pgdat);
  38. *active += l;
  39. *inactive += m;
  40. *free += n;
  41. }
  42. }
  43. #ifdef CONFIG_VM_EVENT_COUNTERS
  44. DEFINE_PER_CPU(struct vm_event_state, vm_event_states) = {{0}};
  45. EXPORT_PER_CPU_SYMBOL(vm_event_states);
  46. static void sum_vm_events(unsigned long *ret, cpumask_t *cpumask)
  47. {
  48. int cpu = 0;
  49. int i;
  50. memset(ret, 0, NR_VM_EVENT_ITEMS * sizeof(unsigned long));
  51. cpu = first_cpu(*cpumask);
  52. while (cpu < NR_CPUS) {
  53. struct vm_event_state *this = &per_cpu(vm_event_states, cpu);
  54. cpu = next_cpu(cpu, *cpumask);
  55. if (cpu < NR_CPUS)
  56. prefetch(&per_cpu(vm_event_states, cpu));
  57. for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
  58. ret[i] += this->event[i];
  59. }
  60. }
  61. /*
  62. * Accumulate the vm event counters across all CPUs.
  63. * The result is unavoidably approximate - it can change
  64. * during and after execution of this function.
  65. */
  66. void all_vm_events(unsigned long *ret)
  67. {
  68. sum_vm_events(ret, &cpu_online_map);
  69. }
  70. EXPORT_SYMBOL_GPL(all_vm_events);
  71. #ifdef CONFIG_HOTPLUG
  72. /*
  73. * Fold the foreign cpu events into our own.
  74. *
  75. * This is adding to the events on one processor
  76. * but keeps the global counts constant.
  77. */
  78. void vm_events_fold_cpu(int cpu)
  79. {
  80. struct vm_event_state *fold_state = &per_cpu(vm_event_states, cpu);
  81. int i;
  82. for (i = 0; i < NR_VM_EVENT_ITEMS; i++) {
  83. count_vm_events(i, fold_state->event[i]);
  84. fold_state->event[i] = 0;
  85. }
  86. }
  87. #endif /* CONFIG_HOTPLUG */
  88. #endif /* CONFIG_VM_EVENT_COUNTERS */
  89. /*
  90. * Manage combined zone based / global counters
  91. *
  92. * vm_stat contains the global counters
  93. */
  94. atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
  95. EXPORT_SYMBOL(vm_stat);
  96. #ifdef CONFIG_SMP
  97. static int calculate_threshold(struct zone *zone)
  98. {
  99. int threshold;
  100. int mem; /* memory in 128 MB units */
  101. /*
  102. * The threshold scales with the number of processors and the amount
  103. * of memory per zone. More memory means that we can defer updates for
  104. * longer, more processors could lead to more contention.
  105. * fls() is used to have a cheap way of logarithmic scaling.
  106. *
  107. * Some sample thresholds:
  108. *
  109. * Threshold Processors (fls) Zonesize fls(mem+1)
  110. * ------------------------------------------------------------------
  111. * 8 1 1 0.9-1 GB 4
  112. * 16 2 2 0.9-1 GB 4
  113. * 20 2 2 1-2 GB 5
  114. * 24 2 2 2-4 GB 6
  115. * 28 2 2 4-8 GB 7
  116. * 32 2 2 8-16 GB 8
  117. * 4 2 2 <128M 1
  118. * 30 4 3 2-4 GB 5
  119. * 48 4 3 8-16 GB 8
  120. * 32 8 4 1-2 GB 4
  121. * 32 8 4 0.9-1GB 4
  122. * 10 16 5 <128M 1
  123. * 40 16 5 900M 4
  124. * 70 64 7 2-4 GB 5
  125. * 84 64 7 4-8 GB 6
  126. * 108 512 9 4-8 GB 6
  127. * 125 1024 10 8-16 GB 8
  128. * 125 1024 10 16-32 GB 9
  129. */
  130. mem = zone->present_pages >> (27 - PAGE_SHIFT);
  131. threshold = 2 * fls(num_online_cpus()) * (1 + fls(mem));
  132. /*
  133. * Maximum threshold is 125
  134. */
  135. threshold = min(125, threshold);
  136. return threshold;
  137. }
  138. /*
  139. * Refresh the thresholds for each zone.
  140. */
  141. static void refresh_zone_stat_thresholds(void)
  142. {
  143. struct zone *zone;
  144. int cpu;
  145. int threshold;
  146. for_each_zone(zone) {
  147. if (!zone->present_pages)
  148. continue;
  149. threshold = calculate_threshold(zone);
  150. for_each_online_cpu(cpu)
  151. zone_pcp(zone, cpu)->stat_threshold = threshold;
  152. }
  153. }
  154. /*
  155. * For use when we know that interrupts are disabled.
  156. */
  157. void __mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
  158. int delta)
  159. {
  160. struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id());
  161. s8 *p = pcp->vm_stat_diff + item;
  162. long x;
  163. x = delta + *p;
  164. if (unlikely(x > pcp->stat_threshold || x < -pcp->stat_threshold)) {
  165. zone_page_state_add(x, zone, item);
  166. x = 0;
  167. }
  168. *p = x;
  169. }
  170. EXPORT_SYMBOL(__mod_zone_page_state);
  171. /*
  172. * For an unknown interrupt state
  173. */
  174. void mod_zone_page_state(struct zone *zone, enum zone_stat_item item,
  175. int delta)
  176. {
  177. unsigned long flags;
  178. local_irq_save(flags);
  179. __mod_zone_page_state(zone, item, delta);
  180. local_irq_restore(flags);
  181. }
  182. EXPORT_SYMBOL(mod_zone_page_state);
  183. /*
  184. * Optimized increment and decrement functions.
  185. *
  186. * These are only for a single page and therefore can take a struct page *
  187. * argument instead of struct zone *. This allows the inclusion of the code
  188. * generated for page_zone(page) into the optimized functions.
  189. *
  190. * No overflow check is necessary and therefore the differential can be
  191. * incremented or decremented in place which may allow the compilers to
  192. * generate better code.
  193. * The increment or decrement is known and therefore one boundary check can
  194. * be omitted.
  195. *
  196. * NOTE: These functions are very performance sensitive. Change only
  197. * with care.
  198. *
  199. * Some processors have inc/dec instructions that are atomic vs an interrupt.
  200. * However, the code must first determine the differential location in a zone
  201. * based on the processor number and then inc/dec the counter. There is no
  202. * guarantee without disabling preemption that the processor will not change
  203. * in between and therefore the atomicity vs. interrupt cannot be exploited
  204. * in a useful way here.
  205. */
  206. static void __inc_zone_state(struct zone *zone, enum zone_stat_item item)
  207. {
  208. struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id());
  209. s8 *p = pcp->vm_stat_diff + item;
  210. (*p)++;
  211. if (unlikely(*p > pcp->stat_threshold)) {
  212. int overstep = pcp->stat_threshold / 2;
  213. zone_page_state_add(*p + overstep, zone, item);
  214. *p = -overstep;
  215. }
  216. }
  217. void __inc_zone_page_state(struct page *page, enum zone_stat_item item)
  218. {
  219. __inc_zone_state(page_zone(page), item);
  220. }
  221. EXPORT_SYMBOL(__inc_zone_page_state);
  222. void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
  223. {
  224. struct zone *zone = page_zone(page);
  225. struct per_cpu_pageset *pcp = zone_pcp(zone, smp_processor_id());
  226. s8 *p = pcp->vm_stat_diff + item;
  227. (*p)--;
  228. if (unlikely(*p < - pcp->stat_threshold)) {
  229. int overstep = pcp->stat_threshold / 2;
  230. zone_page_state_add(*p - overstep, zone, item);
  231. *p = overstep;
  232. }
  233. }
  234. EXPORT_SYMBOL(__dec_zone_page_state);
  235. void inc_zone_state(struct zone *zone, enum zone_stat_item item)
  236. {
  237. unsigned long flags;
  238. local_irq_save(flags);
  239. __inc_zone_state(zone, item);
  240. local_irq_restore(flags);
  241. }
  242. void inc_zone_page_state(struct page *page, enum zone_stat_item item)
  243. {
  244. unsigned long flags;
  245. struct zone *zone;
  246. zone = page_zone(page);
  247. local_irq_save(flags);
  248. __inc_zone_state(zone, item);
  249. local_irq_restore(flags);
  250. }
  251. EXPORT_SYMBOL(inc_zone_page_state);
  252. void dec_zone_page_state(struct page *page, enum zone_stat_item item)
  253. {
  254. unsigned long flags;
  255. local_irq_save(flags);
  256. __dec_zone_page_state(page, item);
  257. local_irq_restore(flags);
  258. }
  259. EXPORT_SYMBOL(dec_zone_page_state);
  260. /*
  261. * Update the zone counters for one cpu.
  262. */
  263. void refresh_cpu_vm_stats(int cpu)
  264. {
  265. struct zone *zone;
  266. int i;
  267. unsigned long flags;
  268. for_each_zone(zone) {
  269. struct per_cpu_pageset *pcp;
  270. if (!populated_zone(zone))
  271. continue;
  272. pcp = zone_pcp(zone, cpu);
  273. for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
  274. if (pcp->vm_stat_diff[i]) {
  275. local_irq_save(flags);
  276. zone_page_state_add(pcp->vm_stat_diff[i],
  277. zone, i);
  278. pcp->vm_stat_diff[i] = 0;
  279. local_irq_restore(flags);
  280. }
  281. }
  282. }
  283. static void __refresh_cpu_vm_stats(void *dummy)
  284. {
  285. refresh_cpu_vm_stats(smp_processor_id());
  286. }
  287. /*
  288. * Consolidate all counters.
  289. *
  290. * Note that the result is less inaccurate but still inaccurate
  291. * if concurrent processes are allowed to run.
  292. */
  293. void refresh_vm_stats(void)
  294. {
  295. on_each_cpu(__refresh_cpu_vm_stats, NULL, 0, 1);
  296. }
  297. EXPORT_SYMBOL(refresh_vm_stats);
  298. #endif
  299. #ifdef CONFIG_NUMA
  300. /*
  301. * zonelist = the list of zones passed to the allocator
  302. * z = the zone from which the allocation occurred.
  303. *
  304. * Must be called with interrupts disabled.
  305. */
  306. void zone_statistics(struct zonelist *zonelist, struct zone *z)
  307. {
  308. if (z->zone_pgdat == zonelist->zones[0]->zone_pgdat) {
  309. __inc_zone_state(z, NUMA_HIT);
  310. } else {
  311. __inc_zone_state(z, NUMA_MISS);
  312. __inc_zone_state(zonelist->zones[0], NUMA_FOREIGN);
  313. }
  314. if (z->node == numa_node_id())
  315. __inc_zone_state(z, NUMA_LOCAL);
  316. else
  317. __inc_zone_state(z, NUMA_OTHER);
  318. }
  319. #endif
  320. #ifdef CONFIG_PROC_FS
  321. #include <linux/seq_file.h>
  322. static void *frag_start(struct seq_file *m, loff_t *pos)
  323. {
  324. pg_data_t *pgdat;
  325. loff_t node = *pos;
  326. for (pgdat = first_online_pgdat();
  327. pgdat && node;
  328. pgdat = next_online_pgdat(pgdat))
  329. --node;
  330. return pgdat;
  331. }
  332. static void *frag_next(struct seq_file *m, void *arg, loff_t *pos)
  333. {
  334. pg_data_t *pgdat = (pg_data_t *)arg;
  335. (*pos)++;
  336. return next_online_pgdat(pgdat);
  337. }
  338. static void frag_stop(struct seq_file *m, void *arg)
  339. {
  340. }
  341. /*
  342. * This walks the free areas for each zone.
  343. */
  344. static int frag_show(struct seq_file *m, void *arg)
  345. {
  346. pg_data_t *pgdat = (pg_data_t *)arg;
  347. struct zone *zone;
  348. struct zone *node_zones = pgdat->node_zones;
  349. unsigned long flags;
  350. int order;
  351. for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; ++zone) {
  352. if (!populated_zone(zone))
  353. continue;
  354. spin_lock_irqsave(&zone->lock, flags);
  355. seq_printf(m, "Node %d, zone %8s ", pgdat->node_id, zone->name);
  356. for (order = 0; order < MAX_ORDER; ++order)
  357. seq_printf(m, "%6lu ", zone->free_area[order].nr_free);
  358. spin_unlock_irqrestore(&zone->lock, flags);
  359. seq_putc(m, '\n');
  360. }
  361. return 0;
  362. }
  363. const struct seq_operations fragmentation_op = {
  364. .start = frag_start,
  365. .next = frag_next,
  366. .stop = frag_stop,
  367. .show = frag_show,
  368. };
  369. #ifdef CONFIG_ZONE_DMA32
  370. #define TEXT_FOR_DMA32(xx) xx "_dma32",
  371. #else
  372. #define TEXT_FOR_DMA32(xx)
  373. #endif
  374. #ifdef CONFIG_HIGHMEM
  375. #define TEXT_FOR_HIGHMEM(xx) xx "_high",
  376. #else
  377. #define TEXT_FOR_HIGHMEM(xx)
  378. #endif
  379. #define TEXTS_FOR_ZONES(xx) xx "_dma", TEXT_FOR_DMA32(xx) xx "_normal", \
  380. TEXT_FOR_HIGHMEM(xx)
  381. static const char * const vmstat_text[] = {
  382. /* Zoned VM counters */
  383. "nr_anon_pages",
  384. "nr_mapped",
  385. "nr_file_pages",
  386. "nr_slab_reclaimable",
  387. "nr_slab_unreclaimable",
  388. "nr_page_table_pages",
  389. "nr_dirty",
  390. "nr_writeback",
  391. "nr_unstable",
  392. "nr_bounce",
  393. "nr_vmscan_write",
  394. #ifdef CONFIG_NUMA
  395. "numa_hit",
  396. "numa_miss",
  397. "numa_foreign",
  398. "numa_interleave",
  399. "numa_local",
  400. "numa_other",
  401. #endif
  402. #ifdef CONFIG_VM_EVENT_COUNTERS
  403. "pgpgin",
  404. "pgpgout",
  405. "pswpin",
  406. "pswpout",
  407. TEXTS_FOR_ZONES("pgalloc")
  408. "pgfree",
  409. "pgactivate",
  410. "pgdeactivate",
  411. "pgfault",
  412. "pgmajfault",
  413. TEXTS_FOR_ZONES("pgrefill")
  414. TEXTS_FOR_ZONES("pgsteal")
  415. TEXTS_FOR_ZONES("pgscan_kswapd")
  416. TEXTS_FOR_ZONES("pgscan_direct")
  417. "pginodesteal",
  418. "slabs_scanned",
  419. "kswapd_steal",
  420. "kswapd_inodesteal",
  421. "pageoutrun",
  422. "allocstall",
  423. "pgrotated",
  424. #endif
  425. };
  426. /*
  427. * Output information about zones in @pgdat.
  428. */
  429. static int zoneinfo_show(struct seq_file *m, void *arg)
  430. {
  431. pg_data_t *pgdat = arg;
  432. struct zone *zone;
  433. struct zone *node_zones = pgdat->node_zones;
  434. unsigned long flags;
  435. for (zone = node_zones; zone - node_zones < MAX_NR_ZONES; zone++) {
  436. int i;
  437. if (!populated_zone(zone))
  438. continue;
  439. spin_lock_irqsave(&zone->lock, flags);
  440. seq_printf(m, "Node %d, zone %8s", pgdat->node_id, zone->name);
  441. seq_printf(m,
  442. "\n pages free %lu"
  443. "\n min %lu"
  444. "\n low %lu"
  445. "\n high %lu"
  446. "\n active %lu"
  447. "\n inactive %lu"
  448. "\n scanned %lu (a: %lu i: %lu)"
  449. "\n spanned %lu"
  450. "\n present %lu",
  451. zone->free_pages,
  452. zone->pages_min,
  453. zone->pages_low,
  454. zone->pages_high,
  455. zone->nr_active,
  456. zone->nr_inactive,
  457. zone->pages_scanned,
  458. zone->nr_scan_active, zone->nr_scan_inactive,
  459. zone->spanned_pages,
  460. zone->present_pages);
  461. for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
  462. seq_printf(m, "\n %-12s %lu", vmstat_text[i],
  463. zone_page_state(zone, i));
  464. seq_printf(m,
  465. "\n protection: (%lu",
  466. zone->lowmem_reserve[0]);
  467. for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++)
  468. seq_printf(m, ", %lu", zone->lowmem_reserve[i]);
  469. seq_printf(m,
  470. ")"
  471. "\n pagesets");
  472. for_each_online_cpu(i) {
  473. struct per_cpu_pageset *pageset;
  474. int j;
  475. pageset = zone_pcp(zone, i);
  476. for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
  477. if (pageset->pcp[j].count)
  478. break;
  479. }
  480. if (j == ARRAY_SIZE(pageset->pcp))
  481. continue;
  482. for (j = 0; j < ARRAY_SIZE(pageset->pcp); j++) {
  483. seq_printf(m,
  484. "\n cpu: %i pcp: %i"
  485. "\n count: %i"
  486. "\n high: %i"
  487. "\n batch: %i",
  488. i, j,
  489. pageset->pcp[j].count,
  490. pageset->pcp[j].high,
  491. pageset->pcp[j].batch);
  492. }
  493. #ifdef CONFIG_SMP
  494. seq_printf(m, "\n vm stats threshold: %d",
  495. pageset->stat_threshold);
  496. #endif
  497. }
  498. seq_printf(m,
  499. "\n all_unreclaimable: %u"
  500. "\n prev_priority: %i"
  501. "\n start_pfn: %lu",
  502. zone->all_unreclaimable,
  503. zone->prev_priority,
  504. zone->zone_start_pfn);
  505. spin_unlock_irqrestore(&zone->lock, flags);
  506. seq_putc(m, '\n');
  507. }
  508. return 0;
  509. }
  510. const struct seq_operations zoneinfo_op = {
  511. .start = frag_start, /* iterate over all zones. The same as in
  512. * fragmentation. */
  513. .next = frag_next,
  514. .stop = frag_stop,
  515. .show = zoneinfo_show,
  516. };
  517. static void *vmstat_start(struct seq_file *m, loff_t *pos)
  518. {
  519. unsigned long *v;
  520. #ifdef CONFIG_VM_EVENT_COUNTERS
  521. unsigned long *e;
  522. #endif
  523. int i;
  524. if (*pos >= ARRAY_SIZE(vmstat_text))
  525. return NULL;
  526. #ifdef CONFIG_VM_EVENT_COUNTERS
  527. v = kmalloc(NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long)
  528. + sizeof(struct vm_event_state), GFP_KERNEL);
  529. #else
  530. v = kmalloc(NR_VM_ZONE_STAT_ITEMS * sizeof(unsigned long),
  531. GFP_KERNEL);
  532. #endif
  533. m->private = v;
  534. if (!v)
  535. return ERR_PTR(-ENOMEM);
  536. for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++)
  537. v[i] = global_page_state(i);
  538. #ifdef CONFIG_VM_EVENT_COUNTERS
  539. e = v + NR_VM_ZONE_STAT_ITEMS;
  540. all_vm_events(e);
  541. e[PGPGIN] /= 2; /* sectors -> kbytes */
  542. e[PGPGOUT] /= 2;
  543. #endif
  544. return v + *pos;
  545. }
  546. static void *vmstat_next(struct seq_file *m, void *arg, loff_t *pos)
  547. {
  548. (*pos)++;
  549. if (*pos >= ARRAY_SIZE(vmstat_text))
  550. return NULL;
  551. return (unsigned long *)m->private + *pos;
  552. }
  553. static int vmstat_show(struct seq_file *m, void *arg)
  554. {
  555. unsigned long *l = arg;
  556. unsigned long off = l - (unsigned long *)m->private;
  557. seq_printf(m, "%s %lu\n", vmstat_text[off], *l);
  558. return 0;
  559. }
  560. static void vmstat_stop(struct seq_file *m, void *arg)
  561. {
  562. kfree(m->private);
  563. m->private = NULL;
  564. }
  565. const struct seq_operations vmstat_op = {
  566. .start = vmstat_start,
  567. .next = vmstat_next,
  568. .stop = vmstat_stop,
  569. .show = vmstat_show,
  570. };
  571. #endif /* CONFIG_PROC_FS */
  572. #ifdef CONFIG_SMP
  573. /*
  574. * Use the cpu notifier to insure that the thresholds are recalculated
  575. * when necessary.
  576. */
  577. static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb,
  578. unsigned long action,
  579. void *hcpu)
  580. {
  581. switch (action) {
  582. case CPU_UP_PREPARE:
  583. case CPU_UP_CANCELED:
  584. case CPU_DEAD:
  585. refresh_zone_stat_thresholds();
  586. break;
  587. default:
  588. break;
  589. }
  590. return NOTIFY_OK;
  591. }
  592. static struct notifier_block __cpuinitdata vmstat_notifier =
  593. { &vmstat_cpuup_callback, NULL, 0 };
  594. int __init setup_vmstat(void)
  595. {
  596. refresh_zone_stat_thresholds();
  597. register_cpu_notifier(&vmstat_notifier);
  598. return 0;
  599. }
  600. module_init(setup_vmstat)
  601. #endif