diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2023-08-24 15:25:56 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-08-24 15:25:56 -0700 |
commit | fcbc329fa39ef261ba9072c56c63563423bff798 (patch) | |
tree | 2be4883f0089822d4436a8e6a5ba9032f9a025f5 /mm/shmem.c | |
parent | a644b0abbfe1d7cf775082cafdcc7b5f3c35becf (diff) | |
parent | e5548f85b4527c4c803b7eae7887c10bf8f90c97 (diff) |
merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 20daa207d8bf..99fb60ec2c3d 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -806,14 +806,16 @@ unsigned long shmem_partial_swap_usage(struct address_space *mapping, XA_STATE(xas, &mapping->i_pages, start); struct page *page; unsigned long swapped = 0; + unsigned long max = end - 1; rcu_read_lock(); - xas_for_each(&xas, page, end - 1) { + xas_for_each(&xas, page, max) { if (xas_retry(&xas, page)) continue; if (xa_is_value(page)) swapped++; - + if (xas.xa_index == max) + break; if (need_resched()) { xas_pause(&xas); cond_resched_rcu(); |