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 3B75220DE3 for ; Mon, 12 Jan 2026 05:01:42 +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=1768194104; cv=none; b=UESdsnzaqs6EIz8mRRGmtURQ+2+C9QTtMXYhUk6zsrdI2r9W7CcAEod0hojG37wTUifdXPAn11Azuur+aDwmbiMJThPyNLW2aH7ffAJeUIkd571/LedG42fNo7QRwP+z8pbHpcRM8ON5xgPICR5ZuOtoniW+emT+ji9+9ZTaRzQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768194104; c=relaxed/simple; bh=RPPkY9XAdFslRRtRlwS9viQMuRPM3oSoOtRTtnpA+cA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=q9yIjQ8tz0MCb1JmZ+hlj99I3EK8NBuIa3jbsnt612RgRFMRTHHlAbkWGWe+6c7n/iuPS1KB3Dw5UPWpN2+AonO1M6oqexKO88+T4Z6kfAIfTDtv/mW/j/eIF1aEaKZlVzf//RasZVW7PVfBeOuHr6lUqxTux+szSV0pfHtSLfg= 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=A5Ty4nLd; 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="A5Ty4nLd" 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=tyzpqUZ7yNMiE15jNn2+/Ob6xCGrAy07kXSER8vdYjg=; b=A5Ty4nLdPydlZ+W/lnQN936T/XphStVxvBtLUF5Zq6jZ67vtVvusfDLEf2Cd+c7MzlWq/SeqqpZ BkNJxLeynjTDwx0DdspCpe2VdazZYD5A63fvGXhfBHOQBrhUIcMIMQm+OC1+OzIBNDjAxRpRf1o+u ODPD3KquG8cGDfQNPpcUNKevjaisViLQ35vGLKZmo1dIkj79gGkfBI3DOTnFFqF5kX5amdraWjrFg sisHg65uzYtiMynWpB+J0SA9iT3CllulmGFHSI3v65e4mRa1UOkKGqW/NA9Zt+w/EbaRBDgMICp/u U0AhE2u+dDCxUGpiT95vBTlmQW1Um+oHHHdA==; Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.96 #2 (Debian)) id 1vfA3D-00Fxah-2j; Mon, 12 Jan 2026 13:01:12 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Mon, 12 Jan 2026 13:01:11 +0800 Date: Mon, 12 Jan 2026 13:01:11 +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: <9b7d6e6292c64f21b8d09def1b6723f02faffe88@linux.dev> <53zplsrqc66z4ea64cosy53zvttuuhgxr2ik7uw6i2zgluegyz@d3ulgntwnyw4> <2iophcy2e6vk72ypxeshmen66e7jhr52zr34parn4uw6vdyjef@frnpfrltrky2> 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 Fri, Jan 09, 2026 at 04:02:51PM +0000, Yosry Ahmed wrote: > > Herbert, do you mind taking a look at this? It looks sane to me except > for one question below. Looks alright to me too. > > + size_t sizes[2]; > > + > > + /* this object spans two pages */ > > + sizes[0] = PAGE_SIZE - off; > > + sizes[1] = mem_len - sizes[0]; > > + > > + sg_init_table(sg, 2); > > + sg_set_page(sg, zpdesc_page(zpdesc), sizes[0], off); > > + > > + zpdesc = get_next_zpdesc(zpdesc); > > + sg = sg_next(sg); > > Is this stateful? Will the SG list be returned pointing at the second > page now? It makes no difference because we just called sg_init_table(sg, 2), so sg_next(sg) is equivalent to &sg[1]. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt