From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pz2-f37.google.com (mail-pz2-f37.google.com [74.125.228.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DCBD3B0AC3 for ; Wed, 30 Sep 2026 06:08:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.37 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790748489; cv=none; b=LVRQq+ZSbU3TmkEWYjCfHX7OaauR32KshDUrRGuUvLzh6UpMoJgHZAzQOyBd3OGfszLZPdOTtLb3+meO1N/I1nHtEuaAS+PQqd+l9SmRD/Ntqz1g7gA8YJ+pWXkj5ZKN+CZzle4CGGfMeMUhNwkoUSCjdM6GOw2QTxvM4vzw1Rg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790748489; c=relaxed/simple; bh=FQT7C9mEtUI9zyQeAiy/rz7mwvm/L9IqR2P4MCxmtag=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pJKDZcnzH+2jAyESJOMvJIV1HdvjF1agxe5SafmTeM9n0q/8vSTUX+88Eua4APy0+qFZRjitunv+YBUJOF5DxENddmyN7D4LljRjSudi+ZNbHNJfGh6Ma1ZU9C+Xe/tABGs1wI1JM78/MJYD9oVRjThIv0fEOdqpKPjpDiDzf0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=LXZ/240V; arc=none smtp.client-ip=74.125.228.37 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.b="LXZ/240V" Received: by mail-pz2-f37.google.com with SMTP id d2e1a72fcca58-8873070bcd0so63966b3a.0 for ; Tue, 29 Sep 2026 23:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1790748487; x=1791353287; darn=lists.linux.dev; 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=CgFmFj2igJGpmbRflOSd7wans++uMlq7r70gUY54Vy0=; b=LXZ/240V8tmJhM7Azkym/zPMEe/J9Ha8/S+k+NAWQH8QkPi7xlWKbtA/YahH6bcnIq EkWCU5bwPotZugM3VzZnIX4y9EkWQK8/A3WeRBi+faLiXC2G2vt5R9jJgBf+CNSvmp1W PiqOcUKEBd7XfmXYbydGT8yNPK+M4j46ESui0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790748487; x=1791353287; 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=CgFmFj2igJGpmbRflOSd7wans++uMlq7r70gUY54Vy0=; b=0GRmOtG00K1jWdMQzHXNaugL5eCNjxGpW96JW4UcivvVLW40GKr+nL6+CPFcBN3B1u OmnASEKYTeVl/JTpRyDxxsoWYCtRUoP2RlVkWQcd2CjiZSo/nJQS9k9YidCFRRKgQ5/y yMEqdjGi3dco5J9oWY4f+v5sIhGjjdEtJVn67EThyu9+nq0PZ1Wvlmpb8UMWOvRCyGml Br0NPRZWUBq1jadmSNZr41uH/z4DI/QHzLOmMvzgS0mL5z5jic4DWYz48d/TkIpPYK2K SaEhD7NxNg9loVE78aLk3DC5pDGOS6Dod+0Kc4lFaBcXZdgalP+f+vWq+/9neBF4aiYP kbnA== X-Forwarded-Encrypted: i=1; AKwUvBwQ8BDZBs0F6fiCsRS7ByAH1dIjnQpt/9IGs7IVlO5VvBsrHMtWYCi99Bpx0i3rT3kOh8yq@lists.linux.dev X-Gm-Message-State: AFuF++lQHf6vdsRLY2ReKGUj1FHkUhgmKkPC8F7H+DDEbwDQ4fOC3JDH lic7nGs1QkDdgu7JyiGYZ5YqlLK39fXnxFXRtf6U3SIuWxbp+o9eo+LCOa+mH9JmKQ== X-Gm-Gg: AYBFou3H+gjMFnwxyGb4gfZtiqufSnawbRwFaKBvXs6GKiNlxSRXz3EHfZhBTkdha0z renRdfcKn1gFT+CRkLx/qM4p2feyxm2P/SK+Dd9BgQ2YN2/hfq8HdinZ1PQ+8mAHrauQ8M/U5xq 2bHRtn+jU8sfQJHCLIYCrTeLPnwhb4Wdf/qEkzINyedrkHZqDvsQFgY8t6+Gbc4onOBTWZWmZXd a46DdsOjKZbeEmRd87UW07YdMiu94N4RSVP7zeQof4YAECSht026o6UHxE/q8UJYBkFP3YC6F8i +i6xej+MvX6Wj9dhrr4/aoT0QWvWCv8nCcryWVB2eItMNFz+3hqVUREPY2TTnUZlHZrLG0Zkswb SZRVOj7xfu1miogXviBqUxS8s6vI7EHtakMB4qS72dO8zmCCxe2vaoK0UUJv8wv/VXyotmpewIR bQ7Gn2H4DN1PAyLgVOFbbkBug9LE8m1QAwDbI4dUNS658hhum2itFVhHQko5djVTkdpL5Tb5tW7 /UrDfpZbZJcbhWD/Xum07OlJkMXjonYVIkIT8BskPevsdQs1g== X-Received: by 2002:a05:6a21:492:b0:3de:3bd5:604c with SMTP id adf61e73a8af0-3de9e87f358mr387844637.41.1790748487167; Tue, 29 Sep 2026 23:08:07 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:31b3:f8c3:893a:d0bb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-88725d68389sm247895b3a.39.2026.09.29.23.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2026 23:08:06 -0700 (PDT) Date: Wed, 30 Sep 2026 15:07:56 +0900 From: Sergey Senozhatsky To: Michal Wilczynski Cc: Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , 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-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 , Herbert Xu , Phillip Lougher , Sungguk , Jaehoon Chung , Marek Szyprowski , linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, linux-crypto@vger.kernel.org Subject: Re: [PATCH RFC 1/9] lib/lz4: import upstream LZ4 sources verbatim Message-ID: References: <20260925-lz4-vendor-upstream-v1-0-1c7ffbe21c4b@samsung.com> <20260925-lz4-vendor-upstream-v1-1-1c7ffbe21c4b@samsung.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260925-lz4-vendor-upstream-v1-1-1c7ffbe21c4b@samsung.com> On (26/09/25 13:27), Michal Wilczynski wrote: [..] > +void LZ4_resetStream_fast(LZ4_stream_t* ctx) { > + LZ4_prepareTable(&(ctx->internal_donotuse), 0, byU32); > +} [..] > +void LZ4_attach_dictionary(LZ4_stream_t* workingStream, const LZ4_stream_t* dictionaryStream) > +{ > + const LZ4_stream_t_internal* dictCtx = (dictionaryStream == NULL) ? NULL : > + &(dictionaryStream->internal_donotuse); > + > + DEBUGLOG(4, "LZ4_attach_dictionary (%p, %p, size %u)", > + workingStream, dictionaryStream, > + dictCtx != NULL ? dictCtx->dictSize : 0); > + > + if (dictCtx != NULL) { > + /* If the current offset is zero, we will never look in the > + * external dictionary context, since there is no value a table > + * entry can take that indicate a miss. In that case, we need > + * to bump the offset to something non-zero. > + */ > + if (workingStream->internal_donotuse.currentOffset == 0) { > + workingStream->internal_donotuse.currentOffset = 64 KB; > + } > + > + /* Don't actually attach an empty dictionary. > + */ > + if (dictCtx->dictSize == 0) { > + dictCtx = NULL; > + } > + } > + workingStream->internal_donotuse.dictCtx = dictCtx; > +} Just a side note, there is a bunch of new helpful API added in this release. Currently, we do some memcpy hacks to avoid re-init of lz4 C/D-dict in zram, but once this series lands I'll be happy to send some trivial EXPORT_SYMBOL patches so that zram (and other lz4 users) can use standard lz4 dict API instead of hacks. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7A99CA5FB5 for ; Wed, 30 Sep 2026 06:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:In-Reply-To:MIME-Version:References:Message-ID:To:From:Date:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NTM9wD1F/ep1xsu0s6fE1yr5EeJNBW92yuiyNR1T5Xw=; b=R4qrcCxjoNrek3HVEoSAASsVLy aLnWQrYhL65ovANwEpQ1pgFgqkn4oi4d5qk3Gd63233nidlUaUHWT4euhrSuBipQDIAARXbCvrxpB lsaxdzOFX9V5buMJxo2dSLkDiaSB8F/CMoz11p+gRlSPoW1FLK8tNtaMjRXuTybdQXyE=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1xBnUH-0005er-KY; Wed, 30 Sep 2026 06:08:15 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1xBnUG-0005ej-Mg for linux-f2fs-devel@lists.sourceforge.net; Wed, 30 Sep 2026 06:08:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CgFmFj2igJGpmbRflOSd7wans++uMlq7r70gUY54Vy0=; b=bwtWF1XSGqPnSrMkz8jGaac8KL UxD8mAirXMUCtGhc3huFZ2PpfnNHBbZ56cHccJrn73VLlmYDij3HMbAS8GphxVaNEoxyJIszl5s7p tkRndtEFDZfrY+ccW2rRZYablqIXI39ewMk4B4uoB7mHkThJfOl2jXLL4qqxdw1ZnOrI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CgFmFj2igJGpmbRflOSd7wans++uMlq7r70gUY54Vy0=; b=HEv4FM6yPSpxiqyDXVxhhtj+2q iBGTiYIXMl7ckjomeuTIhTsXrOCq87lAeMkVodIQzUf5D4Wh/FTOOC3jZ9WjuxLHW/QBYoNIbaVGw FyM6N1OxZc3QeEyrpKrCweS39BV0MMUznVJhxS09hyP8R5XBzygoM93Yq5YFkTj47OVo=; Received: from mail-pz2-f43.google.com ([74.125.228.43]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1xBnUC-0002kb-Ri for linux-f2fs-devel@lists.sourceforge.net; Wed, 30 Sep 2026 06:08:14 +0000 Received: by mail-pz2-f43.google.com with SMTP id d2e1a72fcca58-8631d0023daso2509159b3a.2 for ; Tue, 29 Sep 2026 23:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1790748487; x=1791353287; darn=lists.sourceforge.net; 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=CgFmFj2igJGpmbRflOSd7wans++uMlq7r70gUY54Vy0=; b=XCrx+2/bDfojkILtzAgwXp1BmI8So4gkSNKNxgkLXWdtFF+y9qhVKhxjMkaMTqZVNg LqwYbfoJLqLxJJL8gLTUSNpyMW305mw7/2YCKTNPPJLxyIy0CudFBgBN9GLOV8DHLrXz xCpXTGMaeQstHwakwUlWH02MD29l7eDE8psuw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790748487; x=1791353287; 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=CgFmF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JGCd6J30ulHfjMUOVOS IhCYdxMviG4xo2qFX1T58JgvrGOzN2V87KjMnl65+e+t5iVjLGzGxrz+DWWfjSHeMH4htyS/+U7 vxWUGygI6ODi93kuDpj8KHLMD0RFLob+Ubf3ZS16kT1fxwNQQ== X-Received: by 2002:a05:6a21:492:b0:3de:3bd5:604c with SMTP id adf61e73a8af0-3de9e87f358mr387844637.41.1790748487167; Tue, 29 Sep 2026 23:08:07 -0700 (PDT) Received: from google.com ([2a00:79e0:2031:6:31b3:f8c3:893a:d0bb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-88725d68389sm247895b3a.39.2026.09.29.23.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2026 23:08:06 -0700 (PDT) Date: Wed, 30 Sep 2026 15:07:56 +0900 From: Sergey Senozhatsky To: Michal Wilczynski Message-ID: References: <20260925-lz4-vendor-upstream-v1-0-1c7ffbe21c4b@samsung.com> <20260925-lz4-vendor-upstream-v1-1-1c7ffbe21c4b@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260925-lz4-vendor-upstream-v1-1-1c7ffbe21c4b@samsung.com> X-Headers-End: 1xBnUC-0002kb-Ri Subject: Re: [f2fs-dev] [PATCH RFC 1/9] lib/lz4: import upstream LZ4 sources verbatim X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Hansen , linux-mips@vger.kernel.org, "James E.J. Bottomley" , Bill Wendling , "H. Peter Anvin" , Alexander Gordeev , Sungguk , Marek Szyprowski , linux-s390@vger.kernel.org, Herbert Xu , Minchan Kim , Helge Deller , x86@kernel.org, Russell King , Ingo Molnar , Yann Collet , Gao Xiang , Christian Borntraeger , Sven Schnelle , llvm@lists.linux.dev, Vasily Gorbik , Heiko Carstens , linux-crypto@vger.kernel.org, Nathan Chancellor , Nick Terrell , Borislav Petkov , Jaegeuk Kim , linux-arm-kernel@lists.infradead.org, Jens Axboe , linux-block@vger.kernel.org, Thomas Bogendoerfer , linux-parisc@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, Sergey Senozhatsky , Thomas Gleixner , Justin Stitt , Phillip Lougher , Andrew Morton , linux-erofs@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On (26/09/25 13:27), Michal Wilczynski wrote: [..] > +void LZ4_resetStream_fast(LZ4_stream_t* ctx) { > + LZ4_prepareTable(&(ctx->internal_donotuse), 0, byU32); > +} [..] > +void LZ4_attach_dictionary(LZ4_stream_t* workingStream, const LZ4_stream_t* dictionaryStream) > +{ > + const LZ4_stream_t_internal* dictCtx = (dictionaryStream == NULL) ? NULL : > + &(dictionaryStream->internal_donotuse); > + > + DEBUGLOG(4, "LZ4_attach_dictionary (%p, %p, size %u)", > + workingStream, dictionaryStream, > + dictCtx != NULL ? dictCtx->dictSize : 0); > + > + if (dictCtx != NULL) { > + /* If the current offset is zero, we will never look in the > + * external dictionary context, since there is no value a table > + * entry can take that indicate a miss. In that case, we need > + * to bump the offset to something non-zero. > + */ > + if (workingStream->internal_donotuse.currentOffset == 0) { > + workingStream->internal_donotuse.currentOffset = 64 KB; > + } > + > + /* Don't actually attach an empty dictionary. > + */ > + if (dictCtx->dictSize == 0) { > + dictCtx = NULL; > + } > + } > + workingStream->internal_donotuse.dictCtx = dictCtx; > +} Just a side note, there is a bunch of new helpful API added in this release. Currently, we do some memcpy hacks to avoid re-init of lz4 C/D-dict in zram, but once this series lands I'll be happy to send some trivial EXPORT_SYMBOL patches so that zram (and other lz4 users) can use standard lz4 dict API instead of hacks. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel