swap: cleanup get/put_swap_device() usage
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 15 repliesIn review
v2 from the cover letter
- Split patch per David's comments. Thanks!
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | swap: Remove get/put_swap_device() in __swap_count()mm/ | +2 | 4 replies | |
| 2/5 | swap, __read_swap_cache_async(): enlarge get/put_swap_device protection rangemm/ | +22 | 2 replies | |
| 3/5 | swap: remove __swp_swapcount()include/ mm/ | +3 | 2 replies | |
| 4/5 | swap: remove get/put_swap_device() in __swap_duplicate()mm/ | +1 | 4 replies | |
| 5/5 | swap: comments get_swap_device() with usage rulemm/ | +9 | 3 replies |
Reviews trailers per patch
3 of 5 patches have a Reviewed-by or Acked-by.
| Patch | David Hildenbrand | Yosry Ahmed |
|---|---|---|
| 1/5 | R-b | R-b |
| 2/5 | ||
| 3/5 | ||
| 4/5 | R-b | |
| 5/5 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH -V2 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 isn't some other way to prevent swapoff, such as page lock for swap cache, page table lock, 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:
v2:
- Split patch per David's comments. Thanks!
Best Regards,
Huang, Ying