|
4 | 4 | *
|
5 | 5 | * Common interface definitions for making balloon pages movable by compaction.
|
6 | 6 | *
|
7 |
| - * Despite being perfectly possible to perform ballooned pages migration, they |
8 |
| - * make a special corner case to compaction scans because balloon pages are not |
9 |
| - * enlisted at any LRU list like the other pages we do compact / migrate. |
| 7 | + * Balloon page migration makes use of the general non-lru movable page |
| 8 | + * feature. |
| 9 | + * |
| 10 | + * page->private is used to reference the responsible balloon device. |
| 11 | + * page->mapping is used in context of non-lru page migration to reference |
| 12 | + * the address space operations for page isolation/migration/compaction. |
10 | 13 | *
|
11 | 14 | * As the page isolation scanning step a compaction thread does is a lockless
|
12 | 15 | * procedure (from a page standpoint), it might bring some racy situations while
|
13 | 16 | * performing balloon page compaction. In order to sort out these racy scenarios
|
14 | 17 | * and safely perform balloon's page compaction and migration we must, always,
|
15 |
| - * ensure following these three simple rules: |
| 18 | + * ensure following these simple rules: |
16 | 19 | *
|
17 | 20 | * i. when updating a balloon's page ->mapping element, strictly do it under
|
18 | 21 | * the following lock order, independently of the far superior
|
|
21 | 24 | * +--spin_lock_irq(&b_dev_info->pages_lock);
|
22 | 25 | * ... page->mapping updates here ...
|
23 | 26 | *
|
24 |
| - * ii. before isolating or dequeueing a balloon page from the balloon device |
25 |
| - * pages list, the page reference counter must be raised by one and the |
26 |
| - * extra refcount must be dropped when the page is enqueued back into |
27 |
| - * the balloon device page list, thus a balloon page keeps its reference |
28 |
| - * counter raised only while it is under our special handling; |
29 |
| - * |
30 |
| - * iii. after the lockless scan step have selected a potential balloon page for |
31 |
| - * isolation, re-test the PageBalloon mark and the PagePrivate flag |
32 |
| - * under the proper page lock, to ensure isolating a valid balloon page |
33 |
| - * (not yet isolated, nor under release procedure) |
34 |
| - * |
35 |
| - * iv. isolation or dequeueing procedure must clear PagePrivate flag under |
36 |
| - * page lock together with removing page from balloon device page list. |
| 27 | + * ii. isolation or dequeueing procedure must remove the page from balloon |
| 28 | + * device page list under b_dev_info->pages_lock. |
37 | 29 | *
|
38 | 30 | * The functions provided by this interface are placed to help on coping with
|
39 | 31 | * the aforementioned balloon page corner case, as well as to ensure the simple
|
|
0 commit comments