diff options
| author | Huang Ying <[email protected]> | 2023-05-29 14:13:55 +0800 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-06-09 16:25:50 -0700 |
| commit | a95722a047724ef75567381976a36f0e44230bd9 (patch) | |
| tree | 293c57d3ca8243b7ee6fe66140b975b040b7b5f1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | c07aee4f82af3c466509782b15658837fe53babc (diff) | |
swap: comments get_swap_device() with usage rule
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.
Add the rule as comments of get_swap_device().
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: "Huang, Ying" <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: Yosry Ahmed <[email protected]>
Reviewed-by: Chris Li (Google) <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Tim Chen <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Yu Zhao <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions