Changeset 000350f8 in mainline
- Timestamp:
- 2008-07-06T16:16:32Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2ec725f
- Parents:
- 515a0102
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
r515a0102 r000350f8 1215 1215 ipl_t ipl; 1216 1216 1217 ipl = interrupts_disable();1218 spinlock_lock(&zones.lock);1219 1220 1217 #ifdef __32_BITS__ 1221 1218 printf("# base address free frames busy frames\n"); … … 1228 1225 #endif 1229 1226 1230 for (i = 0; i < zones.count; i++) { 1227 /* 1228 * Because printing may require allocation of memory, we may not hold 1229 * the frame allocator locks when printing zone statistics. Therefore, 1230 * we simply gather the statistics under the protection of the locks and 1231 * print the statistics when the locks have been released. 1232 * 1233 * When someone adds/removes zones while we are printing the statistics, 1234 * we may end up with inaccurate output (e.g. a zone being skipped from 1235 * the listing). 1236 */ 1237 1238 for (i = 0; ; i++) { 1239 uintptr_t base; 1240 count_t free_count; 1241 count_t busy_count; 1242 1243 ipl = interrupts_disable(); 1244 spinlock_lock(&zones.lock); 1245 1246 if (i >= zones.count) { 1247 spinlock_unlock(&zones.lock); 1248 interrupts_restore(ipl); 1249 break; 1250 } 1251 1231 1252 zone = zones.info[i]; 1232 1253 spinlock_lock(&zone->lock); 1233 1254 1255 base = PFN2ADDR(zone->base); 1256 free_count = zone->free_count; 1257 busy_count = zone->busy_count; 1258 1259 spinlock_unlock(&zone->lock); 1260 1261 spinlock_unlock(&zones.lock); 1262 interrupts_restore(ipl); 1263 1234 1264 #ifdef __32_BITS__ 1235 printf("%-2u %10p %12" PRIc " %12" PRIc "\n", 1236 i, PFN2ADDR(zone->base), zone->free_count, 1237 zone->busy_count); 1265 printf("%-2u %10p %12" PRIc " %12" PRIc "\n", i, base, 1266 free_count, busy_count); 1238 1267 #endif 1239 1268 1240 1269 #ifdef __64_BITS__ 1241 printf("%-2u %18p %12" PRIc " %12" PRIc "\n", i, 1242 PFN2ADDR(zone->base), zone->free_count, zone->busy_count);1270 printf("%-2u %18p %12" PRIc " %12" PRIc "\n", i, base, 1271 free_count, busy_count); 1243 1272 #endif 1244 1273 1245 spinlock_unlock(&zone->lock); 1246 } 1247 1248 spinlock_unlock(&zones.lock); 1249 interrupts_restore(ipl); 1274 } 1250 1275 } 1251 1276
Note:
See TracChangeset
for help on using the changeset viewer.