From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from abb.hmeau.com (abb.hmeau.com [180.181.231.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7303369218 for ; Thu, 8 Jan 2026 08:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=180.181.231.80 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767859558; cv=none; b=WquusgP7COU2rs4YlD4OhvitFYdOY/SsmLK/elWDnHnKWzLwL+j47rBbyjGvJ+nglCB+eITeejbkiihGg6Xor/GEjuA5pqLA9bCNW4CrDTWp+9giyGu8zNaDH+YqfxWBqIuruHS0SYnw7C7UieK2JFm/i2WFe+tCvJh3oLonC2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767859558; c=relaxed/simple; bh=5GQp3ygZI9Ryoi49zVlqm2kwSDhmRCOmJb7bD1TS9PM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dTnQp0bHdmaBQ+Rd4eR66MDthZTGqnq8HPjkoctr9dYZZQtCupFHD98TToqO2oR7+2zHVBpZ0yYVKAHHJxa8AV3wIh7A2iKSXCiYkJq/b1DZLSMJaK0NlkmZ9LSkSH2tJ0gr8w3gSLGDmw1aNegB+ULWqQ9n4zA+b1fvznWFXHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au; spf=pass smtp.mailfrom=gondor.apana.org.au; dkim=pass (2048-bit key) header.d=gondor.apana.org.au header.i=@gondor.apana.org.au header.b=IJxBUdqc; arc=none smtp.client-ip=180.181.231.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gondor.apana.org.au Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gondor.apana.org.au header.i=@gondor.apana.org.au header.b="IJxBUdqc" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gondor.apana.org.au; s=h01; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:cc:to:subject:message-id:date: from:content-type:reply-to; bh=Nnr2K4bRNyXoL9NoGQXVILmrNEOTw2nzTzkEYOW5Qxw=; b=IJxBUdqccd3G/9JLd1nt/xTOb70gE8wyBxgoAqC5jyKDjLkh9QvXcUu9lYjTE3wvhUW+Ad5yq3l hOSKYKrZnxszo9E9yjdE8nJunzxUcujx4FaNXIiyHbhl6YnWC78QgrnwojRi9fQQbEieYUC2vsXhX Y/K2r94erTPhWVFme84SWhtGBkT4HRtbjr/dYocgBN/4vrPQB4RcWokmPRyaBixtC8tQ+yt1F8O9P sqgYNsMRX+ajJP4QOsU31M8dGmKXel0lxq/eLGMHGP+1JYdYvhnFoGozLpHPEQy/iq7A5eU4Q/lQO V7b8Ywbc7D/oFkggxAwqSp8MEYAQ7F6r3hFw==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1vdl18-00F386-0p; Thu, 08 Jan 2026 16:05:15 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Thu, 08 Jan 2026 16:05:14 +0800 Date: Thu, 8 Jan 2026 16:05:14 +0800 From: Herbert Xu To: Yosry Ahmed Cc: Sergey Senozhatsky , Andrew Morton , Nhat Pham , Minchan Kim , Johannes Weiner , Brian Geffon , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH 2/2] zsmalloc: chain-length configuration should consider other metrics Message-ID: References: <5p4iyah6zlrnxpbsis32c4m5lrjj3pq7xwcugq35d2entwfai2@n2r6y3ga2ie5> <7q5gqpfshnc3lfhzxughpks3fc2knw2delpm5io2oe54monydl@5isuxnjputjr> <9b7d6e6292c64f21b8d09def1b6723f02faffe88@linux.dev> <53zplsrqc66z4ea64cosy53zvttuuhgxr2ik7uw6i2zgluegyz@d3ulgntwnyw4> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Jan 08, 2026 at 08:01:20AM +0000, Yosry Ahmed wrote: > > IIUC based on Herbert's previous response, crypto and scomp already > support passing in a discontiguous SG-list. So for zswap, if zsmalloc > returns an SG-list, it will just be passed as-is to the crypto API. > > If zram can also use the SG-list, then we can completely drop the > memcpy() logic from zsmalloc. > > Herbert, please correct me if I am wrong. You're correct. The SG support has always been there. You can use that today and scomp will perform the memcpy for you if and only if it's necessary. The algorithm-specific SG support would simply be a performance enhancement that eliminates the memcpy entirely for whichever algorithm that we choose to implement it for. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt