swap: cleanup get/put_swap_device() usage
Status from this message: [merged mm-stable] swap-remove-__swp_swapcount.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
V3 from the cover letter
- Fix build error in [2/5], Thanks David!
- Fix comments and patch description about the folio in swap cache, Thanks David!
- Collected reviewed-by.
Patches in v1 All 5 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | swap: Remove get/put_swap_device() in __swap_count()mm/ | +2 | 1 reply | Applied |
| 2/5 | swap, __read_swap_cache_async(): enlarge get/put_swap_device protection rangemm/ | +21 | 2 replies | Applied |
| 3/5 | swap: remove __swp_swapcount()include/ mm/ mm/ | +4 | 2 replies | Applied |
| 4/5 | swap: remove get/put_swap_device() in __swap_duplicate()mm/ | +1 | 2 replies | Applied |
| 5/5 | swap: comments get_swap_device() with usage rulemm/ | +9 | 1 reply | Applied |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by.
| Patch | Yosry Ahmed | David Hildenbrand | Chris Li (Google) |
|---|---|---|---|
| 1/5 | R-b | R-b | R-b |
| 2/5 | R-b | R-b | |
| 3/5 | R-b | R-b | |
| 4/5 | R-b | R-b | R-b |
| 5/5 | R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH -V3 0/5] swap: cleanup get/put_swap_device() usage
The general rule to use a swap entry is as follows.
When we get a swap entry, if there aren't some other ways to prevent swapoff, such as the folio in swap cache is locked, page table lock is held, etc., the swap entry may become invalid because of swapoff. Then, we need to enclose all swap related functions with get_swap_device() and put_swap_device(), unless the swap functions call get/put_swap_device() by themselves.
Based on the above rule, all get/put_swap_device() usage are checked and cleaned up if necessary.
Changelogs:
V3:
- Fix build error in [2/5], Thanks David!
- Fix comments and patch description about the folio in swap cache, Thanks David!
- Collected reviewed-by.
V2:
- Split patch per David's comments. Thanks!
Best Regards,
Huang, Ying