Changeset d69f959 in mainline
- Timestamp:
- 2010-04-25T19:25:07Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 170332d
- Parents:
- aa028db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/sysinfo/stats.c
raa028db rd69f959 156 156 static size_t get_task_virtmem(as_t *as) 157 157 { 158 mutex_lock(&as->lock);159 160 158 size_t result = 0; 159 160 /* 161 * We are holding some spinlocks here and therefore are not allowed to 162 * block. Only attempt to lock the address space and address space area 163 * mutexes conditionally. If it is not possible to lock either object, 164 * allow the statistics to be inexact by skipping the respective object. 165 * 166 * Note that it may be infinitely better to let the address space 167 * management code compute these statistics as it proceeds instead of 168 * having them calculated here over and over again here. 169 */ 170 171 if (!mutex_trylock(&as->lock)) 172 return result * PAGE_SIZE; 161 173 162 174 /* Walk the B+ tree and count pages */ … … 171 183 as_area_t *area = node->value[i]; 172 184 173 mutex_lock(&area->lock); 185 if (!mutex_trylock(&area->lock)) 186 continue; 174 187 result += area->pages; 175 188 mutex_unlock(&area->lock);
Note:
See TracChangeset
for help on using the changeset viewer.