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 AED231CD1E4 for ; Tue, 13 Jan 2026 04:31:25 +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=1768278689; cv=none; b=YQqydR1X0tDLqTIWEdqu0FF2XyNgKOYZCxPrZMaYG+oh3Wm/WzVQKc6uXPKiS91rm7o5UNYJJO8gpbIuarLP5lTaBQwphBjYyDNKpIqc961sG3lietS5GHgjn0mG+2yk4IQl3KUd7kdRl1x8C+ntWmGDVMhBvbO5LM3p7L+qUpY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768278689; c=relaxed/simple; bh=aLdykJ9/kIYSRB3JFErjkxVReu/2yuzoHluTF43VvgY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uFYkO4FUVNovqxxqCgUMSLELH2qQguemcIGZzFReJph4whTkKbRDgVZeuHbD4lKSY/bizYcmmx+sDRRYc4o97JaM+UqulYbIUftkSn3cHepVw0YmVwUqF54NaK2Bk3JNRtwaBijFgpkBgZBJauEjnxHfD9dxIAnzcSbxNEyqeT4= 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=BAkTdP8q; 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="BAkTdP8q" 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=/pp81rQAMhtIyr/Wtg2fg/qbmVYAdF7/Cz7odtkofXs=; b=BAkTdP8qpghJLdcrfg0qrzk1VDQjiN1SUNcj+XKOLJV1UZR2nTD/vtJ25qL3/Ficf6nggqrAFRA P78UjgHnZoJ063amkA26uAG5/hW/GMF6wb80xQv/neI+nPNO+MZpxHGQYJnn2wwG9Q8CG13JhLASf M+YXgji5qx3H0rle2JIvZnfMakW5c/dWZ663CHt9xShu09k77ArMcPHQ+f4KUGMfidxNae57GDZ+i OKSpsE/6Z/pYeAoaawIY+bqqcQYQLT5HXfV1W0BipTzOziMEhGyvSuDoskklQY4l00KEAm0zpnIuN bNHBUApGlhS3zX6wHDEnLOl7y406uc8k73Yg==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1vfW3V-00GH2y-1T; Tue, 13 Jan 2026 12:30:58 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Tue, 13 Jan 2026 12:30:57 +0800 Date: Tue, 13 Jan 2026 12:30:57 +0800 From: Herbert Xu To: Sergey Senozhatsky Cc: Andrew Morton , Yosry Ahmed , Minchan Kim , Nhat Pham , Johannes Weiner , Brian Geffon , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] zsmalloc: introduce SG-list based object read API Message-ID: References: <20260113034645.2729998-1-senozhatsky@chromium.org> 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: <20260113034645.2729998-1-senozhatsky@chromium.org> On Tue, Jan 13, 2026 at 12:46:45PM +0900, Sergey Senozhatsky wrote: > Currently, zsmalloc performs address linearization on read > (which sometimes requires memcpy() to a local buffer). > Not all zsmalloc users need a linear address. For example, > Crypto API supports SG-list, performing linearization under > the hood, if needed. In addition, some compressors can have > native SG-list support, completely avoiding the linearization > step. > > Provide an SG-list based zsmalloc read API: > - zs_obj_read_sg_begin() > - zs_obj_read_sg_end() > > This API allows callers to obtain an SG representation > of the object (one entry for objects that are contained > in a single page and two entries for spanning objects), > avoiding the need for a bounce buffer and memcpy. > > Signed-off-by: Sergey Senozhatsky > Cc: Herbert Xu > --- > include/linux/zsmalloc.h | 4 +++ > mm/zsmalloc.c | 65 ++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 69 insertions(+) Acked-by: Herbert Xu Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt