aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorChuck Lever <[email protected]>2021-07-14 21:26:52 -0700
committerLinus Torvalds <[email protected]>2021-07-15 10:13:49 -0700
commit061478438d04779181c2ce4d7ffeeca343a70a98 (patch)
tree2b94b564eca59a82457964e815a140024e9fbf38 /tools/perf/scripts/python/export-to-postgresql.py
parente5c15cea339115edf99dc92282865f173cf84510 (diff)
mm/page_alloc: further fix __alloc_pages_bulk() return value
The author of commit b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking populated elements") was possibly confused by the mixture of return values throughout the function. The API contract is clear that the function "Returns the number of pages on the list or array." It does not list zero as a unique return value with a special meaning. Therefore zero is a plausible return value only if @nr_pages is zero or less. Clean up the return logic to make it clear that the returned value is always the total number of pages in the array/list, not the number of pages that were allocated during this call. The only change in behavior with this patch is the value returned if prepare_alloc_pages() fails. To match the API contract, the number of pages currently in the array/list is returned in this case. The call site in __page_pool_alloc_pages_slow() also seems to be confused on this matter. It should be attended to by someone who is familiar with that code. [[email protected]: Return nr_populated if 0 pages are requested] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Mel Gorman <[email protected]> Acked-by: Jesper Dangaard Brouer <[email protected]> Cc: Desmond Cheong Zhi Xi <[email protected]> Cc: Zhang Qiang <[email protected]> Cc: Yanfei Xu <[email protected]> Cc: Matteo Croce <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions