mm: check all swaps belong to same swap_cgroup in swap_pte_batch()
Right now, it is possible two folios are contiguous in swap slots but they
don't belong to one memcg. In this case, even we return a large nr, we
can't really batch free all slots.
Link: https://lkml.kernel.org/r/20240815215308.55233-1-21cnbao@gmail.com
Signed-off-by: Barry Song <v-songbaohua@oppo.com>
Reported-by: Yosry Ahmed <yosryahmed@google.com>
Reported-by: Chris Li <chrisl@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>