@@ -1130,7 +1130,7 @@ static void frag_stop(struct seq_file *m, void *arg)
1130
1130
* If @assert_populated is true, only use callback for zones that are populated.
1131
1131
*/
1132
1132
static void walk_zones_in_node (struct seq_file * m , pg_data_t * pgdat ,
1133
- bool assert_populated ,
1133
+ bool assert_populated , bool nolock ,
1134
1134
void (* print )(struct seq_file * m , pg_data_t * , struct zone * ))
1135
1135
{
1136
1136
struct zone * zone ;
@@ -1141,9 +1141,11 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
1141
1141
if (assert_populated && !populated_zone (zone ))
1142
1142
continue ;
1143
1143
1144
- spin_lock_irqsave (& zone -> lock , flags );
1144
+ if (!nolock )
1145
+ spin_lock_irqsave (& zone -> lock , flags );
1145
1146
print (m , pgdat , zone );
1146
- spin_unlock_irqrestore (& zone -> lock , flags );
1147
+ if (!nolock )
1148
+ spin_unlock_irqrestore (& zone -> lock , flags );
1147
1149
}
1148
1150
}
1149
1151
#endif
@@ -1166,7 +1168,7 @@ static void frag_show_print(struct seq_file *m, pg_data_t *pgdat,
1166
1168
static int frag_show (struct seq_file * m , void * arg )
1167
1169
{
1168
1170
pg_data_t * pgdat = (pg_data_t * )arg ;
1169
- walk_zones_in_node (m , pgdat , true, frag_show_print );
1171
+ walk_zones_in_node (m , pgdat , true, false, frag_show_print );
1170
1172
return 0 ;
1171
1173
}
1172
1174
@@ -1207,7 +1209,7 @@ static int pagetypeinfo_showfree(struct seq_file *m, void *arg)
1207
1209
seq_printf (m , "%6d " , order );
1208
1210
seq_putc (m , '\n' );
1209
1211
1210
- walk_zones_in_node (m , pgdat , true, pagetypeinfo_showfree_print );
1212
+ walk_zones_in_node (m , pgdat , true, false, pagetypeinfo_showfree_print );
1211
1213
1212
1214
return 0 ;
1213
1215
}
@@ -1258,7 +1260,8 @@ static int pagetypeinfo_showblockcount(struct seq_file *m, void *arg)
1258
1260
for (mtype = 0 ; mtype < MIGRATE_TYPES ; mtype ++ )
1259
1261
seq_printf (m , "%12s " , migratetype_names [mtype ]);
1260
1262
seq_putc (m , '\n' );
1261
- walk_zones_in_node (m , pgdat , true, pagetypeinfo_showblockcount_print );
1263
+ walk_zones_in_node (m , pgdat , true, false,
1264
+ pagetypeinfo_showblockcount_print );
1262
1265
1263
1266
return 0 ;
1264
1267
}
@@ -1284,7 +1287,8 @@ static void pagetypeinfo_showmixedcount(struct seq_file *m, pg_data_t *pgdat)
1284
1287
seq_printf (m , "%12s " , migratetype_names [mtype ]);
1285
1288
seq_putc (m , '\n' );
1286
1289
1287
- walk_zones_in_node (m , pgdat , true, pagetypeinfo_showmixedcount_print );
1290
+ walk_zones_in_node (m , pgdat , true, true,
1291
+ pagetypeinfo_showmixedcount_print );
1288
1292
#endif /* CONFIG_PAGE_OWNER */
1289
1293
}
1290
1294
@@ -1446,7 +1450,7 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,
1446
1450
static int zoneinfo_show (struct seq_file * m , void * arg )
1447
1451
{
1448
1452
pg_data_t * pgdat = (pg_data_t * )arg ;
1449
- walk_zones_in_node (m , pgdat , false, zoneinfo_show_print );
1453
+ walk_zones_in_node (m , pgdat , false, false, zoneinfo_show_print );
1450
1454
return 0 ;
1451
1455
}
1452
1456
@@ -1852,7 +1856,7 @@ static int unusable_show(struct seq_file *m, void *arg)
1852
1856
if (!node_state (pgdat -> node_id , N_MEMORY ))
1853
1857
return 0 ;
1854
1858
1855
- walk_zones_in_node (m , pgdat , true, unusable_show_print );
1859
+ walk_zones_in_node (m , pgdat , true, false, unusable_show_print );
1856
1860
1857
1861
return 0 ;
1858
1862
}
@@ -1904,7 +1908,7 @@ static int extfrag_show(struct seq_file *m, void *arg)
1904
1908
{
1905
1909
pg_data_t * pgdat = (pg_data_t * )arg ;
1906
1910
1907
- walk_zones_in_node (m , pgdat , true, extfrag_show_print );
1911
+ walk_zones_in_node (m , pgdat , true, false, extfrag_show_print );
1908
1912
1909
1913
return 0 ;
1910
1914
}
0 commit comments