函数源码 |
Source File:mm\vmstat.c |
Create Date:2022-07-27 15:47:16 |
首页 | Copyright©Brick |
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 | static void pagetypeinfo_showfree_print( struct seq_file *m, pg_data_t *pgdat, struct zone *zone) { int order, mtype; for (mtype = 0; mtype < MIGRATE_TYPES; mtype++) { seq_printf(m, "Node %4d, zone %8s, type %12s " , pgdat->node_id, zone->name, migratetype_names[mtype]); for (order = 0; order < MAX_ORDER; ++order) { unsigned long freecount = 0; struct free_area *area; struct list_head *curr; bool overflow = false ; area = &(zone->free_area[order]); list_for_each(curr, &area->free_list[mtype]) { /* * Cap the free_list iteration because it might * be really large and we are under a spinlock * so a long time spent here could trigger a * hard lockup detector. Anyway this is a * debugging tool so knowing there is a handful * of pages of this order should be more than * sufficient. */ if (++freecount >= 100000) { overflow = true ; break ; } } seq_printf(m, "%s%6lu " , overflow ? ">" : "" , freecount); spin_unlock_irq(&zone->lock); cond_resched(); spin_lock_irq(&zone->lock); } seq_putc(m, '\n' ); } } |