aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/maple.c
diff options
context:
space:
mode:
authorPeter Xu <[email protected]>2023-01-04 22:52:06 +0000
committerAndrew Morton <[email protected]>2023-01-19 01:12:53 +0000
commita79390f5d6a78647fd70856bd42b22d994de0ba2 (patch)
tree4b6528a12bf5bcab1ca80b47029b286f80268f0d /tools/testing/radix-tree/maple.c
parentmm/damon/vaddr: convert hugetlb related functions to use a folio (diff)
downloadkernel-a79390f5d6a78647fd70856bd42b22d994de0ba2.tar.gz
kernel-a79390f5d6a78647fd70856bd42b22d994de0ba2.zip
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/testing/radix-tree/maple.c')
0 files changed, 0 insertions, 0 deletions