Re: [PATCH v4 1/2] mm: store zero pages to be swapped out in a bitmap
From: Yosry Ahmed
Date: Thu Sep 05 2024 - 15:29:00 EST
[..]
> /*
> * Check if all entries have consistent zeromap status, return true if
> * all entries are zeromap or non-zeromap, else return false;
> */
> static inline bool swap_zeromap_entries_check(swp_entry_t entry, int nr)
Let's also rename this now to swap_zeromap_entries_same(), "check" is
a little vague.
> {
> struct swap_info_struct *sis = swp_swap_info(entry);
> unsigned long start = swp_offset(entry);
> unsigned long end = start + *nr;
>
> if (find_next_bit(sis->zeromap, end, start) == end)
> return true;
> if (find_next_zero_bit(sis->zeromap, end, start) == end)
> return true;
>
> return false;
> }
>