appldata_base.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. /*
  2. * arch/s390/appldata/appldata_base.c
  3. *
  4. * Base infrastructure for Linux-z/VM Monitor Stream, Stage 1.
  5. * Exports appldata_register_ops() and appldata_unregister_ops() for the
  6. * data gathering modules.
  7. *
  8. * Copyright IBM Corp. 2003, 2009
  9. *
  10. * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
  11. */
  12. #define KMSG_COMPONENT "appldata"
  13. #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
  14. #include <linux/module.h>
  15. #include <linux/init.h>
  16. #include <linux/slab.h>
  17. #include <linux/errno.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/proc_fs.h>
  20. #include <linux/mm.h>
  21. #include <linux/swap.h>
  22. #include <linux/pagemap.h>
  23. #include <linux/sysctl.h>
  24. #include <linux/notifier.h>
  25. #include <linux/cpu.h>
  26. #include <linux/workqueue.h>
  27. #include <linux/suspend.h>
  28. #include <linux/platform_device.h>
  29. #include <asm/appldata.h>
  30. #include <asm/timer.h>
  31. #include <asm/uaccess.h>
  32. #include <asm/io.h>
  33. #include <asm/smp.h>
  34. #include "appldata.h"
  35. #define APPLDATA_CPU_INTERVAL 10000 /* default (CPU) time for
  36. sampling interval in
  37. milliseconds */
  38. #define TOD_MICRO 0x01000 /* nr. of TOD clock units
  39. for 1 microsecond */
  40. static struct platform_device *appldata_pdev;
  41. /*
  42. * /proc entries (sysctl)
  43. */
  44. static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
  45. static int appldata_timer_handler(ctl_table *ctl, int write,
  46. void __user *buffer, size_t *lenp, loff_t *ppos);
  47. static int appldata_interval_handler(ctl_table *ctl, int write,
  48. void __user *buffer,
  49. size_t *lenp, loff_t *ppos);
  50. static struct ctl_table_header *appldata_sysctl_header;
  51. static struct ctl_table appldata_table[] = {
  52. {
  53. .procname = "timer",
  54. .mode = S_IRUGO | S_IWUSR,
  55. .proc_handler = appldata_timer_handler,
  56. },
  57. {
  58. .procname = "interval",
  59. .mode = S_IRUGO | S_IWUSR,
  60. .proc_handler = appldata_interval_handler,
  61. },
  62. { },
  63. };
  64. static struct ctl_table appldata_dir_table[] = {
  65. {
  66. .procname = appldata_proc_name,
  67. .maxlen = 0,
  68. .mode = S_IRUGO | S_IXUGO,
  69. .child = appldata_table,
  70. },
  71. { },
  72. };
  73. /*
  74. * Timer
  75. */
  76. static DEFINE_PER_CPU(struct vtimer_list, appldata_timer);
  77. static atomic_t appldata_expire_count = ATOMIC_INIT(0);
  78. static DEFINE_SPINLOCK(appldata_timer_lock);
  79. static int appldata_interval = APPLDATA_CPU_INTERVAL;
  80. static int appldata_timer_active;
  81. static int appldata_timer_suspended = 0;
  82. /*
  83. * Work queue
  84. */
  85. static struct workqueue_struct *appldata_wq;
  86. static void appldata_work_fn(struct work_struct *work);
  87. static DECLARE_WORK(appldata_work, appldata_work_fn);
  88. /*
  89. * Ops list
  90. */
  91. static DEFINE_MUTEX(appldata_ops_mutex);
  92. static LIST_HEAD(appldata_ops_list);
  93. /*************************** timer, work, DIAG *******************************/
  94. /*
  95. * appldata_timer_function()
  96. *
  97. * schedule work and reschedule timer
  98. */
  99. static void appldata_timer_function(unsigned long data)
  100. {
  101. if (atomic_dec_and_test(&appldata_expire_count)) {
  102. atomic_set(&appldata_expire_count, num_online_cpus());
  103. queue_work(appldata_wq, (struct work_struct *) data);
  104. }
  105. }
  106. /*
  107. * appldata_work_fn()
  108. *
  109. * call data gathering function for each (active) module
  110. */
  111. static void appldata_work_fn(struct work_struct *work)
  112. {
  113. struct list_head *lh;
  114. struct appldata_ops *ops;
  115. get_online_cpus();
  116. mutex_lock(&appldata_ops_mutex);
  117. list_for_each(lh, &appldata_ops_list) {
  118. ops = list_entry(lh, struct appldata_ops, list);
  119. if (ops->active == 1) {
  120. ops->callback(ops->data);
  121. }
  122. }
  123. mutex_unlock(&appldata_ops_mutex);
  124. put_online_cpus();
  125. }
  126. /*
  127. * appldata_diag()
  128. *
  129. * prepare parameter list, issue DIAG 0xDC
  130. */
  131. int appldata_diag(char record_nr, u16 function, unsigned long buffer,
  132. u16 length, char *mod_lvl)
  133. {
  134. struct appldata_product_id id = {
  135. .prod_nr = {0xD3, 0xC9, 0xD5, 0xE4,
  136. 0xE7, 0xD2, 0xD9}, /* "LINUXKR" */
  137. .prod_fn = 0xD5D3, /* "NL" */
  138. .version_nr = 0xF2F6, /* "26" */
  139. .release_nr = 0xF0F1, /* "01" */
  140. };
  141. id.record_nr = record_nr;
  142. id.mod_lvl = (mod_lvl[0]) << 8 | mod_lvl[1];
  143. return appldata_asm(&id, function, (void *) buffer, length);
  144. }
  145. /************************ timer, work, DIAG <END> ****************************/
  146. /****************************** /proc stuff **********************************/
  147. /*
  148. * appldata_mod_vtimer_wrap()
  149. *
  150. * wrapper function for mod_virt_timer(), because smp_call_function_single()
  151. * accepts only one parameter.
  152. */
  153. static void __appldata_mod_vtimer_wrap(void *p) {
  154. struct {
  155. struct vtimer_list *timer;
  156. u64 expires;
  157. } *args = p;
  158. mod_virt_timer_periodic(args->timer, args->expires);
  159. }
  160. #define APPLDATA_ADD_TIMER 0
  161. #define APPLDATA_DEL_TIMER 1
  162. #define APPLDATA_MOD_TIMER 2
  163. /*
  164. * __appldata_vtimer_setup()
  165. *
  166. * Add, delete or modify virtual timers on all online cpus.
  167. * The caller needs to get the appldata_timer_lock spinlock.
  168. */
  169. static void
  170. __appldata_vtimer_setup(int cmd)
  171. {
  172. u64 per_cpu_interval;
  173. int i;
  174. switch (cmd) {
  175. case APPLDATA_ADD_TIMER:
  176. if (appldata_timer_active)
  177. break;
  178. per_cpu_interval = (u64) (appldata_interval*1000 /
  179. num_online_cpus()) * TOD_MICRO;
  180. for_each_online_cpu(i) {
  181. per_cpu(appldata_timer, i).expires = per_cpu_interval;
  182. smp_call_function_single(i, add_virt_timer_periodic,
  183. &per_cpu(appldata_timer, i),
  184. 1);
  185. }
  186. appldata_timer_active = 1;
  187. break;
  188. case APPLDATA_DEL_TIMER:
  189. for_each_online_cpu(i)
  190. del_virt_timer(&per_cpu(appldata_timer, i));
  191. if (!appldata_timer_active)
  192. break;
  193. appldata_timer_active = 0;
  194. atomic_set(&appldata_expire_count, num_online_cpus());
  195. break;
  196. case APPLDATA_MOD_TIMER:
  197. per_cpu_interval = (u64) (appldata_interval*1000 /
  198. num_online_cpus()) * TOD_MICRO;
  199. if (!appldata_timer_active)
  200. break;
  201. for_each_online_cpu(i) {
  202. struct {
  203. struct vtimer_list *timer;
  204. u64 expires;
  205. } args;
  206. args.timer = &per_cpu(appldata_timer, i);
  207. args.expires = per_cpu_interval;
  208. smp_call_function_single(i, __appldata_mod_vtimer_wrap,
  209. &args, 1);
  210. }
  211. }
  212. }
  213. /*
  214. * appldata_timer_handler()
  215. *
  216. * Start/Stop timer, show status of timer (0 = not active, 1 = active)
  217. */
  218. static int
  219. appldata_timer_handler(ctl_table *ctl, int write,
  220. void __user *buffer, size_t *lenp, loff_t *ppos)
  221. {
  222. int len;
  223. char buf[2];
  224. if (!*lenp || *ppos) {
  225. *lenp = 0;
  226. return 0;
  227. }
  228. if (!write) {
  229. len = sprintf(buf, appldata_timer_active ? "1\n" : "0\n");
  230. if (len > *lenp)
  231. len = *lenp;
  232. if (copy_to_user(buffer, buf, len))
  233. return -EFAULT;
  234. goto out;
  235. }
  236. len = *lenp;
  237. if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
  238. return -EFAULT;
  239. get_online_cpus();
  240. spin_lock(&appldata_timer_lock);
  241. if (buf[0] == '1')
  242. __appldata_vtimer_setup(APPLDATA_ADD_TIMER);
  243. else if (buf[0] == '0')
  244. __appldata_vtimer_setup(APPLDATA_DEL_TIMER);
  245. spin_unlock(&appldata_timer_lock);
  246. put_online_cpus();
  247. out:
  248. *lenp = len;
  249. *ppos += len;
  250. return 0;
  251. }
  252. /*
  253. * appldata_interval_handler()
  254. *
  255. * Set (CPU) timer interval for collection of data (in milliseconds), show
  256. * current timer interval.
  257. */
  258. static int
  259. appldata_interval_handler(ctl_table *ctl, int write,
  260. void __user *buffer, size_t *lenp, loff_t *ppos)
  261. {
  262. int len, interval;
  263. char buf[16];
  264. if (!*lenp || *ppos) {
  265. *lenp = 0;
  266. return 0;
  267. }
  268. if (!write) {
  269. len = sprintf(buf, "%i\n", appldata_interval);
  270. if (len > *lenp)
  271. len = *lenp;
  272. if (copy_to_user(buffer, buf, len))
  273. return -EFAULT;
  274. goto out;
  275. }
  276. len = *lenp;
  277. if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) {
  278. return -EFAULT;
  279. }
  280. interval = 0;
  281. sscanf(buf, "%i", &interval);
  282. if (interval <= 0)
  283. return -EINVAL;
  284. get_online_cpus();
  285. spin_lock(&appldata_timer_lock);
  286. appldata_interval = interval;
  287. __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
  288. spin_unlock(&appldata_timer_lock);
  289. put_online_cpus();
  290. out:
  291. *lenp = len;
  292. *ppos += len;
  293. return 0;
  294. }
  295. /*
  296. * appldata_generic_handler()
  297. *
  298. * Generic start/stop monitoring and DIAG, show status of
  299. * monitoring (0 = not in process, 1 = in process)
  300. */
  301. static int
  302. appldata_generic_handler(ctl_table *ctl, int write,
  303. void __user *buffer, size_t *lenp, loff_t *ppos)
  304. {
  305. struct appldata_ops *ops = NULL, *tmp_ops;
  306. int rc, len, found;
  307. char buf[2];
  308. struct list_head *lh;
  309. found = 0;
  310. mutex_lock(&appldata_ops_mutex);
  311. list_for_each(lh, &appldata_ops_list) {
  312. tmp_ops = list_entry(lh, struct appldata_ops, list);
  313. if (&tmp_ops->ctl_table[2] == ctl) {
  314. found = 1;
  315. }
  316. }
  317. if (!found) {
  318. mutex_unlock(&appldata_ops_mutex);
  319. return -ENODEV;
  320. }
  321. ops = ctl->data;
  322. if (!try_module_get(ops->owner)) { // protect this function
  323. mutex_unlock(&appldata_ops_mutex);
  324. return -ENODEV;
  325. }
  326. mutex_unlock(&appldata_ops_mutex);
  327. if (!*lenp || *ppos) {
  328. *lenp = 0;
  329. module_put(ops->owner);
  330. return 0;
  331. }
  332. if (!write) {
  333. len = sprintf(buf, ops->active ? "1\n" : "0\n");
  334. if (len > *lenp)
  335. len = *lenp;
  336. if (copy_to_user(buffer, buf, len)) {
  337. module_put(ops->owner);
  338. return -EFAULT;
  339. }
  340. goto out;
  341. }
  342. len = *lenp;
  343. if (copy_from_user(buf, buffer,
  344. len > sizeof(buf) ? sizeof(buf) : len)) {
  345. module_put(ops->owner);
  346. return -EFAULT;
  347. }
  348. mutex_lock(&appldata_ops_mutex);
  349. if ((buf[0] == '1') && (ops->active == 0)) {
  350. // protect work queue callback
  351. if (!try_module_get(ops->owner)) {
  352. mutex_unlock(&appldata_ops_mutex);
  353. module_put(ops->owner);
  354. return -ENODEV;
  355. }
  356. ops->callback(ops->data); // init record
  357. rc = appldata_diag(ops->record_nr,
  358. APPLDATA_START_INTERVAL_REC,
  359. (unsigned long) ops->data, ops->size,
  360. ops->mod_lvl);
  361. if (rc != 0) {
  362. pr_err("Starting the data collection for %s "
  363. "failed with rc=%d\n", ops->name, rc);
  364. module_put(ops->owner);
  365. } else
  366. ops->active = 1;
  367. } else if ((buf[0] == '0') && (ops->active == 1)) {
  368. ops->active = 0;
  369. rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
  370. (unsigned long) ops->data, ops->size,
  371. ops->mod_lvl);
  372. if (rc != 0)
  373. pr_err("Stopping the data collection for %s "
  374. "failed with rc=%d\n", ops->name, rc);
  375. module_put(ops->owner);
  376. }
  377. mutex_unlock(&appldata_ops_mutex);
  378. out:
  379. *lenp = len;
  380. *ppos += len;
  381. module_put(ops->owner);
  382. return 0;
  383. }
  384. /*************************** /proc stuff <END> *******************************/
  385. /************************* module-ops management *****************************/
  386. /*
  387. * appldata_register_ops()
  388. *
  389. * update ops list, register /proc/sys entries
  390. */
  391. int appldata_register_ops(struct appldata_ops *ops)
  392. {
  393. if (ops->size > APPLDATA_MAX_REC_SIZE)
  394. return -EINVAL;
  395. ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL);
  396. if (!ops->ctl_table)
  397. return -ENOMEM;
  398. mutex_lock(&appldata_ops_mutex);
  399. list_add(&ops->list, &appldata_ops_list);
  400. mutex_unlock(&appldata_ops_mutex);
  401. ops->ctl_table[0].procname = appldata_proc_name;
  402. ops->ctl_table[0].maxlen = 0;
  403. ops->ctl_table[0].mode = S_IRUGO | S_IXUGO;
  404. ops->ctl_table[0].child = &ops->ctl_table[2];
  405. ops->ctl_table[2].procname = ops->name;
  406. ops->ctl_table[2].mode = S_IRUGO | S_IWUSR;
  407. ops->ctl_table[2].proc_handler = appldata_generic_handler;
  408. ops->ctl_table[2].data = ops;
  409. ops->sysctl_header = register_sysctl_table(ops->ctl_table);
  410. if (!ops->sysctl_header)
  411. goto out;
  412. return 0;
  413. out:
  414. mutex_lock(&appldata_ops_mutex);
  415. list_del(&ops->list);
  416. mutex_unlock(&appldata_ops_mutex);
  417. kfree(ops->ctl_table);
  418. return -ENOMEM;
  419. }
  420. /*
  421. * appldata_unregister_ops()
  422. *
  423. * update ops list, unregister /proc entries, stop DIAG if necessary
  424. */
  425. void appldata_unregister_ops(struct appldata_ops *ops)
  426. {
  427. mutex_lock(&appldata_ops_mutex);
  428. list_del(&ops->list);
  429. mutex_unlock(&appldata_ops_mutex);
  430. unregister_sysctl_table(ops->sysctl_header);
  431. kfree(ops->ctl_table);
  432. }
  433. /********************** module-ops management <END> **************************/
  434. /**************************** suspend / resume *******************************/
  435. static int appldata_freeze(struct device *dev)
  436. {
  437. struct appldata_ops *ops;
  438. int rc;
  439. struct list_head *lh;
  440. get_online_cpus();
  441. spin_lock(&appldata_timer_lock);
  442. if (appldata_timer_active) {
  443. __appldata_vtimer_setup(APPLDATA_DEL_TIMER);
  444. appldata_timer_suspended = 1;
  445. }
  446. spin_unlock(&appldata_timer_lock);
  447. put_online_cpus();
  448. mutex_lock(&appldata_ops_mutex);
  449. list_for_each(lh, &appldata_ops_list) {
  450. ops = list_entry(lh, struct appldata_ops, list);
  451. if (ops->active == 1) {
  452. rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
  453. (unsigned long) ops->data, ops->size,
  454. ops->mod_lvl);
  455. if (rc != 0)
  456. pr_err("Stopping the data collection for %s "
  457. "failed with rc=%d\n", ops->name, rc);
  458. }
  459. }
  460. mutex_unlock(&appldata_ops_mutex);
  461. return 0;
  462. }
  463. static int appldata_restore(struct device *dev)
  464. {
  465. struct appldata_ops *ops;
  466. int rc;
  467. struct list_head *lh;
  468. get_online_cpus();
  469. spin_lock(&appldata_timer_lock);
  470. if (appldata_timer_suspended) {
  471. __appldata_vtimer_setup(APPLDATA_ADD_TIMER);
  472. appldata_timer_suspended = 0;
  473. }
  474. spin_unlock(&appldata_timer_lock);
  475. put_online_cpus();
  476. mutex_lock(&appldata_ops_mutex);
  477. list_for_each(lh, &appldata_ops_list) {
  478. ops = list_entry(lh, struct appldata_ops, list);
  479. if (ops->active == 1) {
  480. ops->callback(ops->data); // init record
  481. rc = appldata_diag(ops->record_nr,
  482. APPLDATA_START_INTERVAL_REC,
  483. (unsigned long) ops->data, ops->size,
  484. ops->mod_lvl);
  485. if (rc != 0) {
  486. pr_err("Starting the data collection for %s "
  487. "failed with rc=%d\n", ops->name, rc);
  488. }
  489. }
  490. }
  491. mutex_unlock(&appldata_ops_mutex);
  492. return 0;
  493. }
  494. static int appldata_thaw(struct device *dev)
  495. {
  496. return appldata_restore(dev);
  497. }
  498. static const struct dev_pm_ops appldata_pm_ops = {
  499. .freeze = appldata_freeze,
  500. .thaw = appldata_thaw,
  501. .restore = appldata_restore,
  502. };
  503. static struct platform_driver appldata_pdrv = {
  504. .driver = {
  505. .name = "appldata",
  506. .owner = THIS_MODULE,
  507. .pm = &appldata_pm_ops,
  508. },
  509. };
  510. /************************* suspend / resume <END> ****************************/
  511. /******************************* init / exit *********************************/
  512. static void __cpuinit appldata_online_cpu(int cpu)
  513. {
  514. init_virt_timer(&per_cpu(appldata_timer, cpu));
  515. per_cpu(appldata_timer, cpu).function = appldata_timer_function;
  516. per_cpu(appldata_timer, cpu).data = (unsigned long)
  517. &appldata_work;
  518. atomic_inc(&appldata_expire_count);
  519. spin_lock(&appldata_timer_lock);
  520. __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
  521. spin_unlock(&appldata_timer_lock);
  522. }
  523. static void __cpuinit appldata_offline_cpu(int cpu)
  524. {
  525. del_virt_timer(&per_cpu(appldata_timer, cpu));
  526. if (atomic_dec_and_test(&appldata_expire_count)) {
  527. atomic_set(&appldata_expire_count, num_online_cpus());
  528. queue_work(appldata_wq, &appldata_work);
  529. }
  530. spin_lock(&appldata_timer_lock);
  531. __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
  532. spin_unlock(&appldata_timer_lock);
  533. }
  534. static int __cpuinit appldata_cpu_notify(struct notifier_block *self,
  535. unsigned long action,
  536. void *hcpu)
  537. {
  538. switch (action) {
  539. case CPU_ONLINE:
  540. case CPU_ONLINE_FROZEN:
  541. appldata_online_cpu((long) hcpu);
  542. break;
  543. case CPU_DEAD:
  544. case CPU_DEAD_FROZEN:
  545. appldata_offline_cpu((long) hcpu);
  546. break;
  547. default:
  548. break;
  549. }
  550. return NOTIFY_OK;
  551. }
  552. static struct notifier_block __cpuinitdata appldata_nb = {
  553. .notifier_call = appldata_cpu_notify,
  554. };
  555. /*
  556. * appldata_init()
  557. *
  558. * init timer, register /proc entries
  559. */
  560. static int __init appldata_init(void)
  561. {
  562. int i, rc;
  563. rc = platform_driver_register(&appldata_pdrv);
  564. if (rc)
  565. return rc;
  566. appldata_pdev = platform_device_register_simple("appldata", -1, NULL,
  567. 0);
  568. if (IS_ERR(appldata_pdev)) {
  569. rc = PTR_ERR(appldata_pdev);
  570. goto out_driver;
  571. }
  572. appldata_wq = create_singlethread_workqueue("appldata");
  573. if (!appldata_wq) {
  574. rc = -ENOMEM;
  575. goto out_device;
  576. }
  577. get_online_cpus();
  578. for_each_online_cpu(i)
  579. appldata_online_cpu(i);
  580. put_online_cpus();
  581. /* Register cpu hotplug notifier */
  582. register_hotcpu_notifier(&appldata_nb);
  583. appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
  584. return 0;
  585. out_device:
  586. platform_device_unregister(appldata_pdev);
  587. out_driver:
  588. platform_driver_unregister(&appldata_pdrv);
  589. return rc;
  590. }
  591. __initcall(appldata_init);
  592. /**************************** init / exit <END> ******************************/
  593. EXPORT_SYMBOL_GPL(appldata_register_ops);
  594. EXPORT_SYMBOL_GPL(appldata_unregister_ops);
  595. EXPORT_SYMBOL_GPL(appldata_diag);
  596. #ifdef CONFIG_SWAP
  597. EXPORT_SYMBOL_GPL(si_swapinfo);
  598. #endif
  599. EXPORT_SYMBOL_GPL(nr_threads);
  600. EXPORT_SYMBOL_GPL(nr_running);
  601. EXPORT_SYMBOL_GPL(nr_iowait);