On Thu, Mar 06, 2025 at 08:40:27AM +0800, Herbert Xu wrote: > On Wed, Mar 05, 2025 at 04:25:44PM +0000, Yosry Ahmed wrote: > > > > Zswap is already using an SG list when calling into the crypto API. The > > problem is that SGs (i.e. sg_init_one()) does not support kmap highmem > > addresses. Is there a fundamental reason this can't happen, or is it > > just sg_set_bug() using virt_to_page(). > > The whole point of SG lists is so that you don't need to kmap it > until the data is actually accessed. Putting kmapped memory into > the SG lists defeats the purpose. I saw your patch in the other thread and I like just passing a SG list from zsmalloc to zswap, and passing it as-is to the crypto API. The problem of virt vs highmem addresses organically goes away with that. Thanks.