diff options
| author | Peter Xu <[email protected]> | 2023-01-04 17:52:06 -0500 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-01-18 17:12:53 -0800 |
| commit | a79390f5d6a78647fd70856bd42b22d994de0ba2 (patch) | |
| tree | 4b6528a12bf5bcab1ca80b47029b286f80268f0d /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 6b7cea90c82e104c1151fec1f3ee216997fda652 (diff) | |
mm/mprotect: use long for page accountings and retval
Switch to use type "long" for page accountings and retval across the whole
procedure of change_protection().
The change should have shrinked the possible maximum page number to be
half comparing to previous (ULONG_MAX / 2), but it shouldn't overflow on
any system either because the maximum possible pages touched by change
protection should be ULONG_MAX / PAGE_SIZE.
Two reasons to switch from "unsigned long" to "long":
1. It suites better on count_vm_numa_events(), whose 2nd parameter takes
a long type.
2. It paves way for returning negative (error) values in the future.
Currently the only caller that consumes this retval is change_prot_numa(),
where the unsigned long was converted to an int. Since at it, touching up
the numa code to also take a long, so it'll avoid any possible overflow
too during the int-size convertion.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Peter Xu <[email protected]>
Acked-by: Mike Kravetz <[email protected]>
Acked-by: James Houghton <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: Nadav Amit <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions