From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796265679; b=odYaKkzUUq5eUlCckr9NhyX4V1xDrodLBezG6odc5i7dBbgROVK5jth4RquOZ2djH7ZU x+RRFwFfDgpwmsHaS4EDDXLE9GtPQCRveqb0wKkK6COjQw+50GelWFpcjKwBbVIrHupRo ZfOtm8+qZ7PKI/OEAHY4MmlZDfPR3GmYqYFY0FBqK7SgnfS76z8u+Vq2k0uDtVGzIomW+ KS64KihbdQ18Dk/8BHUuinz6pyczdDOQCFTE9Ga7T3s9hiHhox45KNbomtBzI1OoWJ+6/ edPZiiR8RoDmdtj4q5JWOOLtLSUuke32aMkxPpsu08bs79NtRxbXPmbEjC1E5ZuGwwA== 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=5dL6lO7gUju17uC3LiZJjsvyS4xeR4lZyVP7qPAPZK8M64yRflmS/ilEWieRiqRFjn3P ik/D6jfEf7ukHip5ZsZz4KUJINn8BsOey2pJ/xXUWHF+UwI8MbU49/h9BaHWy5mRUNen6 hxKWa4lZ9r6Xq+oFsBvmLjLP3OVeRZzKaperCcLFBSrZzrtVFoMCGJAxlD+4XE+oPNtDs Yeedk4Onj/IMcoc1X0IsLuEqV78h0B/66l38moUfD0BJkmYKxYxxUR0yjsLjp9iFcOf5T L/Ec7K6FtpTBDZkho2O8apllFnOQV5pYKDiLaC6QLnzngHB6xCZm7Sn3vbB2hmXmOCg== 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.182 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (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 F171B606A336 for ; Thu, 3 Dec 2026 02:41:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F171B606A336 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-f182.google.com with SMTP id 5a478bee46e88-38431138772so18783524eec.1 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=ygV2KDsZtLamzA8CJqraKwYyHy6/nVUTIbVDAYUJ9GgPeLTzAbdxS9sM9HL18pn6oe XCmcmtAVRwiw98prh8kEz2bUaqNGQ6cnpkP++WIkofwKh0+7v1qhUe/iiAI2u+Pd3YMN 1BbAiv3DR5lKBR0JSMR7lILGamisLe91/jOMkfMNVbTnCH3wKPxitnpP1tze9dN3sAgM CIbC8+O8rpQvMMSQQv3nI7T/WCN2ZImofVg8zFbUpDgTaBlKJyv17DsTNmfkRA2hMEJG S5lcIEPqoVfezCHqbUeDlfnoDt813VL2tE6C/FFntBkB4Xu0U53byk10GbCJpW5ryWxb PBog== X-Forwarded-Encrypted: i=1; AL+hErFrUUZQGUgyXcHdhg9MBhwky+f89nOM4TyQJK6WpRfBC9mzkxgAMfaKxuO2Xqjpf7u6Np5WZb/Eu1bAvow=@vger.kernel.org X-Gm-Message-State: APuU4Z9V6/0nfQu3y8QgWsLVctWtfgScD82T+bYQaPVx8cUsZo05Czif kf8aog0QeHPKd21gWF4ECo/rrw5Q9Y/xSqeBGW0MXGEURYbhyNTq7S1Fxbcpby0i5A== X-Gm-Gg: AZFdTZcawyosh184c/hOCQYtp1lF3+wJPmzynxbgMSQ4uGga74+Y3bg4odz4Zj0bx6c JTl4TQj9PyPV7/xtSw/gMPTHHzs4q0BKjV4alGa6bAavYMFEB5wCWExVS/DYPCOCTciXFjBqNaN Zs+mXRA0EWIdU4JW5qe2XEmTId2HQ01J+O5dgxM6xOiStjkKJ8mBxM+tDTQjKvHRcafPoUWqrmY Z6bUL9EY4WmdRtpHuqmQ+HnkiNoHlBaWt1KVUn3hU+aIpy4pjXAx9UjmuhuoxSLb8aRenCuSz+r ltbXPRrgs2+SQsvbRSPZdNvgR7sGTjU2U2Sz0ydHLtKW84lFmsLaTcCaQBN2/M0hisER399huE1 RI2aVjiFCpIfWaBaBVIq0XfbRPgWoyoN9fDVQlBeSQuSrziQ/SLvBMzp3Q0Oc5WPPRHA7vcpIFT oKsJ81iJFm3c8LmT5GMbwg8D991b5ixlXDojxxSfuaUkyviDFm+mMzhh4LpalgWgMyLhc9+YDf2 8WMwj+E52V1dJkYI1ZSOlRf8wl7wXfdsg6hV79VXx00xM2fExWTWymbdOyvDvbDSKXymh4k0siZ 8tuYqkGD8Zems3bineDMB8ZcN2izTG/5KBdjbYijiWQVRT1NuuJd/CLtetILHIhXZGd+VRFFGrO KHu+mV8ZRWWe6nQ== 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-parisc@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