From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796265679; b=llgeqz8P2pNPmQVRUQTzeUrqmaH3U/DSIueRohJ5MQW3hegRZ/e0GULPvc8eEEBFqIhn qV4lbyoicxLM2xHxELZsq87vTd9iI+CurVA936bP+c9W4FSfrkPzrhs6c5Irk13OKm4Gv eV8VcAahaRv9l18pxAozZkzGJiyhO0m0rcvUD5wcbnIQP/1wadFTfy8aCg9NViUkL588X MdqunXt9Cfr2I+rcFaPjeq1CaS0pVzLVnjkGoXdtuXR0FNznSYLy1ripgPQX2jFJe5DCC RP7w+3ujvpX/DNSw7FvwrmZP38wHmNj+qId3ZEqnefIzHYyKa3V0XsuKx9PttBS2wzg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796265679; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=uKnFhyi7GPMH4mmXGTANUAn79RXi1xOwPgvVMU5OEDY=; b=HPWCR4GPuKTFUu0VM7a2LGsO1Rm1Tiaq9PSTTHjJxu+orMuEU3lD4w4NqXRyBJB7vefV ypUQPAdqNt8AWZvZIGnPHG41Gg5FBmqc+qN/dE4onoL+kZQbw9SE7Afrzaea/ld0uyZ8b 5aTDComFVHxYcl95eimmA5RYhuYlqlcSDnxgvD4yl7TDYJttqgHwIdq33bjjz+b1Lv0zo 7EX301mH+dH+LH9DDoGCxmNS5u/xMIy9HgKPszBWtrV07nM1oAgV/sCfk9EtYs/cOU9jG RFR+kHe7dSNO4x7cjYpjZgvdQmQGQW4fIaPoqIIHmj6IKAjWyQdu+ZfxxepGLuN0A4Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CheIBSiY; arc=none smtp.remote-ip=74.125.82.180 Received: from mail-dy1-f180.google.com (mail-dy1-f180.google.com [74.125.82.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7F10606A330 for ; Thu, 3 Dec 2026 02:41:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E7F10606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=CheIBSiY Received: by mail-dy1-f180.google.com with SMTP id 5a478bee46e88-386c71feeeaso11826628eec.0 for ; Wed, 02 Dec 2026 18:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1796265678; x=1796870478; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=uKnFhyi7GPMH4mmXGTANUAn79RXi1xOwPgvVMU5OEDY=; b=CheIBSiYEzGHXgAklL1J2Lh1hd9EwOZ3lKXDO7xlBVfQu3r4e79EzTkPAfLc1Jywpx wPQKbsd1l3bY6l9OMxNdq+Pcqzya5155KYmeuhqxYkcE7/hx+QsgO+vu67vEJ6xH/2ET imjdxp/ZPktaXMwp6j2bd6CBYLKE3hTG4IWQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796265678; x=1796870478; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uKnFhyi7GPMH4mmXGTANUAn79RXi1xOwPgvVMU5OEDY=; b=DKUHcyLSSH/mahcmzxhZxW3kO/YiFUaqjcfvVsRju9pnDVs/VkjnuJ4rJPONMq8qP4 72KYFfeDbnTDhnwM18DENZFAyp4NfvjMOoAchwIJEwyrN7BSHcuq9RFiU3cUJ+R9BCAl SYcU75E/s4lMNnhsETq7hbJ3qJzU5lhwdIkerKuDDKvHe8Mu8Rms1+Cjs9/2LhfuIiy2 GAKZ2JrShSeq4yQq87iXI4NC9KTHz1U6TOsbhRhEJlcqsFUnVqtuAE21zLgYwxnNkpRb JJr+1oqUH8qZgggEmeW4b2C69YTWw9TXDsnN+NDbj2VoC6yB2LVbKCaXYjPr/Pld0RK3 thMA== X-Forwarded-Encrypted: i=1; AL+hErHX4ViJ8uO/T2Dk4PP1chiGaw9Ds7/GbT6QZDB+b1+qW1QmeB2LE+el1kjtQW+uWeWsDQo152kx8WiKtQ==@vger.kernel.org X-Gm-Message-State: APuU4Z93ezTCltysZ3wUGx+9K5Yc1JdqKmWBqpiPu3Bw3KnI1Hyl5oxn xPEJzgehNmwFXTad5tP3wuL+hxqQCt3qF+ubgnggmD4AfnBq/uqatL+ndwjikea+Dg== X-Gm-Gg: AZFdTZeDQCbS34dSZ2YUn8fFj5a+yZWH2aqQrTZEsAgxFZeCwdEANI2Em772wjFW3m5 poV93xjJ951N60kd/N0aYfUUZXEhNnTVwW9yghTvqewla43KrFQ9m0SQvctgzCQ520YLJ6G4Oau zE+eoVLYzqjC749pP1993iFOxEG7tYKyhla3euSq5MYqjfY3xZLe7oThNJp5dJ6HOvPvfCuv2Zu iTf8pMoTtMJ8zZojsZDbJwuThBR368SRKn/5A9l+nuE1BBJ7CWqCG9hybvIqKUTavW4ZjM70mmX UwBGZc/5qKfMc3OIoM2dRKKjIwl6A+8w3zJQFrxYhWnAToDjSjRsjZ/YUKAL82YWNJtSP6hJ4/Z YxI18uh3wpsSt/0zGFdjdt4urH2bHE6BvNAFEXA+uTOzYvc3Q4UQErJdbFNh0FLA9xzR3xp0q9x fwP5cjlJHaVovSEzdo7kxQ+G5t2+3MR68F6QnZXHJYBd3LrtBwNhYVkM9u1LEIyMOY0ryqItL4b SICEdCw3lj2+jnAD3DCLycO40oBQg7I49zftdf5oW+18CVEvASL1WiBmzI6Y3or1RCH2SL/LYzw tnB25yad6UiT35H0Yb4opmV33TQMX3Nj7h2RJ8bJmi/nTA6MJmkpa9EbbuJu/D9/QiBf3aqOZMX ZQzTDVaAQ/8u0EA== X-Received: by 2002:a05:693c:65c5:b0:386:b5ce:4627 with SMTP id 5a478bee46e88-386b5ce496bmr29584568eec.30.1796265677994; Wed, 02 Dec 2026 18:41:17 -0800 (PST) Received: from google.com ([2a00:79e0:2031:6:e18c:e957:aa04:7114]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386b9bdafb5sm89953363eec.9.2026.12.02.18.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 18:41:17 -0800 (PST) Date: Thu, 3 Dec 2026 11:41:08 +0900 From: Sergey Senozhatsky To: Michal Wilczynski Cc: Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Richard Henderson , Matt Turner , Magnus Lindholm , Russell King , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Minchan Kim , Sergey Senozhatsky , Jens Axboe , Andrew Morton , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org, linux-block@vger.kernel.org, Yann Collet , Nick Terrell , Gao Xiang , Chao Yu , Jaegeuk Kim , Eric Biggers , Herbert Xu , David Laight , Sungguk , Jaehoon Chung , Marek Szyprowski , linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, linux-crypto@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, Jonathan Corbet , "S. Biplab Raut" Subject: Re: [PATCH v3 04/18] zram: lz4/lz4hc: size the streams by the library's constants Message-ID: References: <20261202-lz4-vendor-upstream-v3-0-a53bffa82fbb@samsung.com> <20261202-lz4-vendor-upstream-v3-4-a53bffa82fbb@samsung.com> X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261202-lz4-vendor-upstream-v3-4-a53bffa82fbb@samsung.com> On (26/12/02 18:32), Michal Wilczynski wrote: > gives the size of a compression stream as > LZ4_MEM_COMPRESS and LZ4HC_MEM_COMPRESS, and lz4_create() and > lz4hc_create() allocate by them. The dictionary streams and the per-page > memcpy() use sizeof() instead, and BUILD_BUG_ON()s tie the two together. > > Use the constants throughout. The vendored library that replaces the > fork later in this series declares LZ4_stream_t and LZ4_streamHC_t as > incomplete types, as upstream does, so sizeof() stops compiling; the > library asserts the constants against upstream's layout at build time > instead. > > lz4hc allocates its streams by lz4hc_mem_compress(params->level): with > the vendored library, levels 10 and up need a workspace after the state. > The per-page memcpy() keeps copying LZ4HC_MEM_COMPRESS bytes, the state > alone, since the workspace holds nothing between calls. > > Signed-off-by: Michal Wilczynski Reviewed-by: Sergey Senozhatsky