From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D434FC282C6 for ; Mon, 3 Mar 2025 20:17:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41211280003; Mon, 3 Mar 2025 15:17:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C1C96B008A; Mon, 3 Mar 2025 15:17:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2891F280003; Mon, 3 Mar 2025 15:17:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 09F7B6B0089 for ; Mon, 3 Mar 2025 15:17:36 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6AE58140F8E for ; Mon, 3 Mar 2025 20:17:35 +0000 (UTC) X-FDA: 83181350070.30.30B1A7F Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) by imf28.hostedemail.com (Postfix) with ESMTP id 93309C0018 for ; Mon, 3 Mar 2025 20:17:33 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=xIGkQl6y; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf28.hostedemail.com: domain of yosry.ahmed@linux.dev designates 95.215.58.183 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741033053; a=rsa-sha256; cv=none; b=Fj9SojNednqCVz6EEzXcPzgVke9Dp2Pl4/b01z7gNJfx2M4aTwNfWp0VMUjiZy2WcvFGaX h4tWzjZuBeie5acIBtMIRz1BpGbH357cbWhDG+x6zPF/ovv4J6hYOFDoUbER37QaYOY3Ad ER+t8YlCci9mLEyM+hmHcVHTSg3UHVE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=xIGkQl6y; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf28.hostedemail.com: domain of yosry.ahmed@linux.dev designates 95.215.58.183 as permitted sender) smtp.mailfrom=yosry.ahmed@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741033053; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tBrtmBoSs2rTsZ8Uol/MTGHwyc4e+wo/BgpFbOP6EXI=; b=iGe8AuC6sfYBt3+0nBxgHBXFeYangVqThLb+mZ8X7zdOklnEKYBabKIqlePVmIHsc7kZPK ETd9g6LUmMHM7e+ka69sRbvCiVznIjEYHOnd8UgbXRUxkbT6KvOxR2gm/JJvhXuVOd/tiF 5QXeOxYOo5m7k87OpsN+t9sTlZOcKQU= Date: Mon, 3 Mar 2025 20:17:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1741033052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tBrtmBoSs2rTsZ8Uol/MTGHwyc4e+wo/BgpFbOP6EXI=; b=xIGkQl6ynHXDrCowub/aY1FH5hJSjlHZzahywTBaF8ZAkVJOcQqNZxdcmyEbOspNh1cBtn BgalJI8tnkuWX9BQ5zyHqXnVv/Ux6RK1II3181QH3q/UhMqJRU6t3wd5QydlLCDQt3Z2Z1 cgv+D+Y13riS0qeLfUm42dC1Z1NC9Ks= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yosry Ahmed To: Herbert Xu Cc: Eric Biggers , Sergey Senozhatsky , Linux Crypto Mailing List , linux-mm@kvack.org Subject: Re: [RFC PATCH 7/7] mm: zswap: Use acomp virtual address interface Message-ID: References: <153c340a52090f2ff82f8f066203186a932d3f99.1740651138.git.herbert@gondor.apana.org.au> <20250227183847.GB1613@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 93309C0018 X-Stat-Signature: 8cd8eozyt7ksjogj7zzb1zeebpnn81eg X-Rspam-User: X-HE-Tag: 1741033053-924395 X-HE-Meta: U2FsdGVkX1+kyeu7CCq9PDrBRn7DOox3VtZ2qa6WOIMlr+jh8jhIkB2C8UnIzUaDXB85AaPwGDZvZvJc5jUD1X7w82mOQhzDvBSEH4F/bVTwImAzHEyc3kh4jmOOucRnh7TgXx399RkBqdE6mzHKkD3QZIh6UoGjVYievc0FVvWxFs+lZZ27Sjfg5bxPrs/RVWR739xqH/PriawpwJVanPMakOGKC6H6sd/Gw5kabRZNKhePvsWrOcp3wa1koqwjfHyK1XNUzMaeqtpJBpsfxK9FmdWn+VNtuNx/d2z8/NA4LerkJP8RWF692ibSbOMDPtqS9TXBRve+W8sNaQtbEZXMboqT8v+onvFxxKJbf8TvPBEUsSn9RTf3Egt/Oe41nOeSt/H3846zlFlvU8NVHnitq84Yiy33Jk6apkcM7NcqgWL8jKFA1kzryUBGNNMnqQy0RNZ5Asw8CHXy98bTBN8Q7YhwY17nvgLQ2J4CC6t6azbDwUuZ7TM+4wA78p6e47lOyUUo9AM3AmQeCm/Bd+lOiyI/giwXDXH+22AvIns7keCs9QZ5Z6sODZ0w3TLu8ON5MSv35B9rBToYNlPEtF39R+okr17j2Fl7QlUxDECy2CQJKHkRNxfQJ+1EeqdC8wwP6rfvIWhX8hkdVSs2xMmtVvrkrPBDCpPetaC48bMG8/COJsAuWw1Im839E8gIV0KdXrUs3uWyvZ7Tz6xfft6Y4YUMymRF40R97HB/XZ/dF5XYfYCrBdWMFfQYEvqv3qGt46NZltcVpgnMHd3fDLZJRIoUPT0uCwBowCxad7nnAgk5j4X6TJb/sniaX2/ytWaKLKQDePpu/uhdM2RH5e3RVD5cFWm3JLVzSMTLCn6QnzkkT33fjX5JmiYGMzKv7WRu6nz+acP0Yro7VoDrpROUPhIHdLTv/c8SDBO9/QczGFZz01iabPgD/ILJq5iAEbnNt/+MjS4miZ9+b/0 rONd0klw +b6dmEI4LGuNxxGnWsPO5d88QZuefsgkqpm99Cy0IedX3i/ymAdKzsjSe9PyCJqwM9lTUsVxUVM5EDXnOS3JO4xdd0zZnX5eM8s/10eMLfxyHynhDWgMQUIOoAzq1HAa6dUWiFDpu5G2CWaBCss9U1xQyUJpd9dNC+Mhk7hZQExOtx/KFcIvqtnAfI5b2zh8SQHxPkj2sqLq/ouyaAfAjjhgBI4A8ACwPpS1KjpELa3z8/8XukaLUrklOAw3AntDADaUV+aTWD1JFxdw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Sat, Mar 01, 2025 at 03:03:48PM +0800, Herbert Xu wrote: > On Sat, Mar 01, 2025 at 02:36:50PM +0800, Herbert Xu wrote: > > > > I thought this was a lot more complicated and you had some weird > > arbtirary pointer from an unknown source. But if it's just highmem > > I can get rid of the memcpy for you right now. > > So it appears that your highmem usage is coming from zsmalloc. In > that case you don't want virtual addresses at all, you want an SG > list. > > In fact you've already gone through a totally unnecessary copy > in _zs_map_object. Had it simply given us a 2-entry SG list, > the Crypto API can process the data directly with no copies at > all. > > The whole point of SG lists is to deal with memory fragmentation. > When your object is too big to fit in a single page, you need an > SG list to describe it. Forcing virtual addresses just leads to > an unnecessary copy. I have seen the other thread with Sergey, I believe the conclusion is that zsmalloc will be updated to use SG lists, at which point zswap can just pass this as-is to the crypto API, and we don't need any copies in either zsmalloc or zswap. Is this correct? Will this patch series be dropped? > > Chers, > -- > Email: Herbert Xu > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt