diff options
| author | Alistair Popple <[email protected]> | 2022-07-29 12:46:45 +1000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2022-09-11 20:25:53 -0700 |
| commit | 24a95998e9baba5e3236d9127d2d302a1a2ad2ab (patch) | |
| tree | 93f8821162b0af3496b0982805b571abf9049791 /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | c37213c5eaaf4c9a6249b14b39426285a4ea89c5 (diff) | |
mm/gup.c: simplify and fix check_and_migrate_movable_pages() return codes
When pinning pages with FOLL_LONGTERM check_and_migrate_movable_pages() is
called to migrate pages out of zones which should not contain any longterm
pinned pages.
When migration succeeds all pages will have been unpinned so pinning needs
to be retried. This is indicated by returning zero. When all pages are
in the correct zone the number of pinned pages is returned.
However migration can also fail, in which case pages are unpinned and
-ENOMEM is returned. However if the failure was due to not being unable
to isolate a page zero is returned. This leads to indefinite looping in
__gup_longterm_locked().
Fix this by simplifying the return codes such that zero indicates all
pages were successfully pinned in the correct zone while errors indicate
either pages were migrated and pinning should be retried or that migration
has failed and therefore the pinning operation should fail.
[[email protected]: fix return value for __gup_longterm_locked()]
Link: https://lkml.kernel.org/r/[email protected]
[[email protected]: fix code layout, per John]
[[email protected]: fix uninitialized return value on __gup_longterm_locked()]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Alistair Popple <[email protected]>
Signed-off-by: Shigeru Yoshida <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: John Hubbard <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Pasha Tatashin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions