Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp333871lqo; Wed, 8 May 2024 00:43:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5Ccl3aftjDxgQt3+yAGQakNQzKDa9JII7igLu0LRN5eVQjzUklekIo85voUqxvJSAFvT0CGeazXuKE+qYVSsVacZGp1jl9aA7veHnZQ== X-Google-Smtp-Source: AGHT+IFizQMIbdE1YNDVvdhWvypww0WKlT6jv966CgRiS+KbsQM5CYiXAwPJ0171PlugyL4mvb1/ X-Received: by 2002:a17:90b:4b11:b0:2a5:df97:b with SMTP id 98e67ed59e1d1-2b6119c8cfcmr2939743a91.18.1715154202298; Wed, 08 May 2024 00:43:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715154202; cv=pass; d=google.com; s=arc-20160816; b=g2JHiKjlgsdUU/QVcDvuU1zOJqlKfSRRcIN2alC5WK1Y4ldlTrzQuycsT4nZ3kAyQx i5hgJ5klE+yQoijB7xdJOO8Gvvsera+4O+hoPqWFQfbu2IyPfTd52Pw9Idwwvp3ZSX0z cdR6paeDW5hm8bcLxUvbXYKrdTbwCDQqSLtgpma91XcoqApjwe4UyV2UnTKUp99OeJ5c nCVFlGnA31lUKMXn0sdAWGnKMcBIKm3dM6Z9jXF3AJfSFV8fZH0YFVmtKk70fLsynb3U qDqufDDfoJmjqLJlVjIqRTYy02Xsr8Y+Vriy7uBB9Tdu3KL/aePndr8J0oiyG8HTtsrH zyfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E0r3IrBqTHQaJKbAMA6Mm9iZI63fDx9y82yERkqABZI=; fh=UKstJvjqAQ3P/Vkvglih02Z8FmmRnlaJbql9clnU9dw=; b=a3ce0I4xwWPAcAqPAtYS3iLhBaQHSM16nBE2mcRPB3OxyybbpoypZpCuQP+BlcPfkz Bs3z7xk22x1yYv2Am8feLuHMVF831sq+bT2kEpNg9krxBq3m92/WreXibRRY6M7mbaoJ lqYkOzossJLW5tyhrVzUgY4LQ2N9C3Ph3XlSLZPm9lfyFuMbibbb/7GYqgUOivduvE6T oh0KoA2zVKtkOVjJBYo81reNzvIeberc2/hwUjGr0mRxkkZJzos/lh9JmS8HYvwdkFsz Awq3uf/rBK7V8UdCBf2dXiBH9fYzMPAQfR5sTFGbxuNNoco8JoDqgQ6IYWER4dmGl3T/ 35LA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jXEgbqkf; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-172828-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bg13-20020a17090b0d8d00b002a545ed0b00si857631pjb.166.2024.05.08.00.43.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:43:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172828-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jXEgbqkf; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-172828-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 40279B226DD for ; Wed, 8 May 2024 07:41:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DA982C856; Wed, 8 May 2024 07:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jXEgbqkf" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 47C1F2C6B9 for ; Wed, 8 May 2024 07:41:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715154094; cv=none; b=tmNh1azLd0QK2C5aGiKYe9B5+MTSzyCh7aQ3CJx+ExsV+aCP/5hExoObFwTDQrzqoLr0pwqwNySgGiqCWkmrFgNI9xGfwwRbqcjOZB74Yk9FYEt9Op/zx6dYOiB0+2KbPgsLB5nZ9CbOaet8CZZ/VrqHLuSIYFG73oi21UA29KQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715154094; c=relaxed/simple; bh=gbESP1QETSXIHhn8KYELBw6pMRCJ9N4ypoUb0Pxk4MQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WUG8uKMboLbvk1TyUR+PM/4SYurc0LqovayQe8KapbsjFJ59m0JUiMdS2S2Qt0ZglXNy6qYSrwIGbgzx7+Vby5NH11ALlw+NFyAqrv310Z3uflSv4dPURYeWk+xcGCexcyXB1P/Wy0GGsib5u0RqmopAflC/avslf6hyZZQRlCI= 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=jXEgbqkf; arc=none smtp.client-ip=209.85.214.169 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 Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1ed012c1afbso4698265ad.1 for ; Wed, 08 May 2024 00:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715154092; x=1715758892; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=E0r3IrBqTHQaJKbAMA6Mm9iZI63fDx9y82yERkqABZI=; b=jXEgbqkfltTRwy8AQ7Sd8GC0jxl8g9vpCIuxCSgL/hWeNEKmSQxyfwi/GgmNzGWWBU hddxQ8eolzUqemwOgD9To4sTqSp7EH4wbvClYh2bZzEdtN3QfYdyH5wpCiyfPfm7QJXi 6CZsXKovyLuTEJRNL5W08ZVbZWI+FVamsgLIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715154092; x=1715758892; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=E0r3IrBqTHQaJKbAMA6Mm9iZI63fDx9y82yERkqABZI=; b=JUvNbkr9Cnas7qg0jqXOTt6mFZH43mt2Saj/6gDN5hXChUYlo1z4T3xOWvFePig2E7 K/EPLseORV9mDCZ3HX8/7amF91rdY3+wzzRPEziDo+chCgc/pObUAotl+3x3j41Q9C3Z sHXpqng1/EEzYEUxhe+IC7zKFKxmAcmsuDj8l+S7RuzOlgxMLIGgXUtb0UO1TtDe7j8Q l95FY0b19EmH23PomobnODeX2STM039cXNS6MczddMAfszXQMNX1xmWqUoLlFYGnj5F+ o7aiJLIS0AlkuT+gqxSn2WAOj1z49+99u+1q5QgEy7xGlx077buj/GFea2svkPKdyA7T spRg== X-Gm-Message-State: AOJu0YzQBcjmaGF+KSnkRS/hceOEPm0OmPZnMuiJpc4Je0IW5pygwp2D MtGS526QqoAEBi1Z2pWt59ta6jnHtduMu13Rd3H2TKavfttsypaPEzvwTUey0g== X-Received: by 2002:a17:902:d4c2:b0:1ea:657f:318f with SMTP id d9443c01a7336-1ee6235c6f3mr77503315ad.0.1715154092630; Wed, 08 May 2024 00:41:32 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:ad4d:5f6c:6699:2da4]) by smtp.gmail.com with ESMTPSA id q9-20020a17090311c900b001e944fc9248sm11130369plh.194.2024.05.08.00.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 00:41:31 -0700 (PDT) Date: Wed, 8 May 2024 16:41:28 +0900 From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCHv2 00/17] zram: convert to custom comp API and allow algorithms configuration Message-ID: <20240508074128.GG8623@google.com> References: <20240506075834.302472-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: <20240506075834.302472-1-senozhatsky@chromium.org> On (24/05/06 16:58), Sergey Senozhatsky wrote: > This patch set moves zram from crypto API to a custom compression > API which allows us to tune and configure compression algorithms, > something that crypto API, unfortunately, doesn't support. Basically, > this seroes brings back the bits of comp "backend" code that we had > many years ago. This means that if we want zram to support new > compression algorithms we need to implement corresponding backends. > > Currently, zram supports a pretty decent number of comp backends: > lzo, lzorle, lz4, lz4hc, 842, deflate, zstd > > At this point we handle 2 parameters: a compression level and > a pre-trained compression dictionary. Which seems like a good enough > start. The list will be extended in the future. > > Examples: > > - changes default compression level > echo "algo=zstd level=11" > /sys/block/zram0/comp_algorithm > > - passes path to a pre-trained dictionary > echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/comp_algorithm I'll send v3 shortly, which adds pre-trained dictionary support to lz4 and lz4hc compression backends. Apparently lz4/lz4hc can use dictionaries pre-trained with zstd --init, just like zstd.