Rev 1434 | Rev 1437 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1434 | Rev 1436 | ||
|---|---|---|---|
| Line 270... | Line 270... | ||
| 270 | * Shrinking the area. |
270 | * Shrinking the area. |
| 271 | * No need to check for overlaps. |
271 | * No need to check for overlaps. |
| 272 | */ |
272 | */ |
| 273 | 273 | ||
| 274 | /* |
274 | /* |
| - | 275 | * Start TLB shootdown sequence. |
|
| - | 276 | */ |
|
| - | 277 | tlb_shootdown_start(TLB_INVL_PAGES, AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages); |
|
| - | 278 | ||
| - | 279 | /* |
|
| 275 | * Remove frames belonging to used space starting from |
280 | * Remove frames belonging to used space starting from |
| 276 | * the highest addresses downwards until an overlap with |
281 | * the highest addresses downwards until an overlap with |
| 277 | * the resized address space area is found. Note that this |
282 | * the resized address space area is found. Note that this |
| 278 | * is also the right way to remove part of the used_space |
283 | * is also the right way to remove part of the used_space |
| 279 | * B+tree leaf list. |
284 | * B+tree leaf list. |
| Line 328... | Line 333... | ||
| 328 | page_mapping_remove(as, b + i*PAGE_SIZE); |
333 | page_mapping_remove(as, b + i*PAGE_SIZE); |
| 329 | page_table_unlock(as, false); |
334 | page_table_unlock(as, false); |
| 330 | } |
335 | } |
| 331 | } |
336 | } |
| 332 | } |
337 | } |
| - | 338 | ||
| 333 | /* |
339 | /* |
| 334 | * Invalidate TLB's. |
340 | * Finish TLB shootdown sequence. |
| 335 | */ |
341 | */ |
| 336 | tlb_shootdown_start(TLB_INVL_PAGES, AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages); |
- | |
| 337 | tlb_invalidate_pages(AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages); |
342 | tlb_invalidate_pages(AS->asid, area->base + pages*PAGE_SIZE, area->pages - pages); |
| 338 | tlb_shootdown_finalize(); |
343 | tlb_shootdown_finalize(); |
| 339 | } else { |
344 | } else { |
| 340 | /* |
345 | /* |
| 341 | * Growing the area. |
346 | * Growing the area. |
| Line 383... | Line 388... | ||
| 383 | } |
388 | } |
| 384 | 389 | ||
| 385 | base = area->base; |
390 | base = area->base; |
| 386 | 391 | ||
| 387 | /* |
392 | /* |
| - | 393 | * Start TLB shootdown sequence. |
|
| - | 394 | */ |
|
| - | 395 | tlb_shootdown_start(TLB_INVL_PAGES, AS->asid, area->base, area->pages); |
|
| - | 396 | ||
| - | 397 | /* |
|
| 388 | * Visit only the pages mapped by used_space B+tree. |
398 | * Visit only the pages mapped by used_space B+tree. |
| 389 | * Note that we must be very careful when walking the tree |
399 | * Note that we must be very careful when walking the tree |
| 390 | * leaf list and removing used space as the leaf list changes |
400 | * leaf list and removing used space as the leaf list changes |
| 391 | * unpredictibly after each remove. The solution is to actually |
401 | * unpredictibly after each remove. The solution is to actually |
| 392 | * not walk the tree at all, but to remove items from the head |
402 | * not walk the tree at all, but to remove items from the head |
| Line 415... | Line 425... | ||
| 415 | } |
425 | } |
| 416 | if (!used_space_remove(area, b, i)) |
426 | if (!used_space_remove(area, b, i)) |
| 417 | panic("Could not remove used space.\n"); |
427 | panic("Could not remove used space.\n"); |
| 418 | } |
428 | } |
| 419 | } |
429 | } |
| 420 | btree_destroy(&area->used_space); |
- | |
| 421 | 430 | ||
| 422 | /* |
431 | /* |
| 423 | * Invalidate TLB's. |
432 | * Finish TLB shootdown sequence. |
| 424 | */ |
433 | */ |
| 425 | tlb_shootdown_start(TLB_INVL_PAGES, AS->asid, area->base, area->pages); |
- | |
| 426 | tlb_invalidate_pages(AS->asid, area->base, area->pages); |
434 | tlb_invalidate_pages(AS->asid, area->base, area->pages); |
| 427 | tlb_shootdown_finalize(); |
435 | tlb_shootdown_finalize(); |
| - | 436 | ||
| - | 437 | btree_destroy(&area->used_space); |
|
| 428 | 438 | ||
| 429 | area->attributes |= AS_AREA_ATTR_PARTIAL; |
439 | area->attributes |= AS_AREA_ATTR_PARTIAL; |
| 430 | 440 | ||
| 431 | if (area->sh_info) |
441 | if (area->sh_info) |
| 432 | sh_info_remove_reference(area->sh_info); |
442 | sh_info_remove_reference(area->sh_info); |