Re: [PATCH v3 11/15] mm, swap: use the swap table for the swap cache and switch API

Lorenzo Stoakes
2025-09-12T09:47:58Z

On Fri, Sep 12, 2025 at 05:42:53PM +0800, Kairui Song wrote:
> Thanks for the info. But I think V3 should be good?
>
> CONFIG_SWAP depends on CONFIG_MMU so if you have !CONFIG_MMU, you must
> have !CONFIG_SWAP.
>
> I didn't adjust the header in V3 and fixed it differently from what
> Lance is suggesting, V3 wraps swp_offset with CONFIG_SWAP. It should
> covers !CONFIG_MMU case too.
>
> The folio_index in V3 (this patch) looks like this:
>
> static inline pgoff_t folio_index(struct folio *folio)
> {
> #ifdef CONFIG_SWAP
> if (unlikely(folio_test_swapcache(folio)))
> return swp_offset(folio->swap);
> #endif
> return folio->index;
> }
>
> I just tested !MMU and it seems fine.

Yup my bad, it's because mm-new is not actually up-to-date properly. So
mm-new build is broken until v3 is taken.