Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp778069lqh; Fri, 31 May 2024 17:24:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8uSe4z+Ls+nUI9HfYa0d7jchSkE2OeX0KNYWpwBkDXVzxC9zW+yg2eUNdP7k+nNic3GZhJB6hdOqYZ7iVeym47g0ImrkGpS1c+Eg57g== X-Google-Smtp-Source: AGHT+IGuJsgJKBRC89nsn8CRcXTnd64hRi7i1Jn/SmoAL6Mrb+UbV9hw0r6EKb2HH9v9UicqJQUs X-Received: by 2002:a05:620a:22b3:b0:792:e153:111b with SMTP id af79cd13be357-794f5c792bfmr324552385a.30.1717201470135; Fri, 31 May 2024 17:24:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717201470; cv=pass; d=google.com; s=arc-20160816; b=i9PiVv1AMPeVw0UwimeLzD2nNDZmZE3Hv+lHJpBH0XXs/xrapTqmTXWJdoCI6PsTLg shGbPVyg8qCDvBjxJFWsQ8w4Hb4cuR/AhL/f/Pt1M11LZdRQWZNF7aVJZoogcimBp+AR DbZ9bUzaIOk5N2cW7xM3dZ+09vC9lIQEb+0BP0Ve+emdeaOVJHK+y4bWpxk6qt8lAFli yOPko7r40NX/vaod23LfTpgCEBI8Q3im3RavZKq29bc7n/Vx0y0xYYA7N/Qep/t457i3 XiaoGczEMGuBgPRoD1MYkUQW8WAX/KcRC/NeCnvK2Uvmfc6M51a0QMFxzfV7IDNBkmkL Bu0Q== 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=vVI0Ewx+/uHRtfPvebLbcoAEnaYNZsWW/E4igELq0H4=; fh=nkDvbxKNmFa73r2y+cr95hxoDMnwgmsGVkg+zm9PGpo=; b=KLto8lxovwEUwata8J1+ZNTgPm0AGoaIYQ6evY3j+5tY/nBFrYAO4AQFzKHUVUWy4U soeA13MdSd7BuXixpcDBP/itwka1WKdGFbj6vknfj+c469cQf2Jiw8AvQxoU0/qq7xmy G1H79I8NKWckCMvm5re963LNtmSp45wrcSfNPhl4EfJnVeADLXvkj/UIPGxiHGA8jQf/ DF3GeDjZdmieq8/zDl2RKyupUy30o3eUVWgr+l0tRmUKSfyVigs374kD6C427O6M/rxs paq/5ENk41hNz5sH9GCjv9P96iFiZv6UQ7NlgQPx+228F0UVw2PWo9RtXvMvBITfjf1y ynuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DHQ90+CG; 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-crypto+bounces-4629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794f318434fsi313641585a.409.2024.05.31.17.24.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 17:24:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DHQ90+CG; 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-crypto+bounces-4629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4629-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C28301C216E5 for ; Sat, 1 Jun 2024 00:24:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB8501869; Sat, 1 Jun 2024 00:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="DHQ90+CG" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 346E017FF for ; Sat, 1 Jun 2024 00:24:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717201462; cv=none; b=J6wj3Sqp7FaLhtARSl1Ia5QEH6yNF6cRI9xs6NcGNZBo4IX8S1CpaN050feeWqqz3IorQQfpr8i5Wx4UEW/sIRlf0BxESi7Z+29oPCRevDOrOi21sdY1uEeZKyQQyUU6ZzKybCuxy2b0VfzSJYcFxtlzJlM941DHEh1CyNC2o60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717201462; c=relaxed/simple; bh=nTJRmyINX1K5OVYROITyZVtB3DeRWIRjl3ImpXlYabE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LGStbSMf4uQZG8YSP33wAzJEFn26f2RKIb8xP0cJP/K2pFNqkBPFlaDcw2R3Mh+u8KUbVgIp2e/ouc7mKCRCvlbqqnE8XyJ4/K7BifApX2KqPyNKychiIm/46K8fhh65JDRmX48weVjV18GLRpyjnp6nXhvUptfRDEfK0V+4I58= 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=DHQ90+CG; arc=none smtp.client-ip=209.85.210.174 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-pf1-f174.google.com with SMTP id d2e1a72fcca58-6ff6fe215c6so2292615b3a.3 for ; Fri, 31 May 2024 17:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1717201460; x=1717806260; 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=vVI0Ewx+/uHRtfPvebLbcoAEnaYNZsWW/E4igELq0H4=; b=DHQ90+CG8MmSIcq0tUSDYj9ob9ZdkB2vHRwKd7wX4lyMGEnlweGN7nk7DSrGbKHeHh 9x4iK6BjkqsyRIy7RsPxXyDr1feCICRGLp6HeimO6bVxPC/6SL5HZUyYXkCYQCDDpfsJ r3LEXwIl3R8gBH78iYPZ4nCtaGjBYemrRz008= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717201460; x=1717806260; 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=vVI0Ewx+/uHRtfPvebLbcoAEnaYNZsWW/E4igELq0H4=; b=TblWIqMhp+umEpihPQwEaFEwLvDTIC4debUaAxs6WewNW45zAexAzpVwDD5/zNZEWT mBswGc6WV6fhseFrEvDxjQg8gbNIUiaF3nMmFKwUSA1S7QzB0Q+/onwzDaZkBk+LF7JX 4gvOYtQjFQL/N1OfbzkgEPizrgN0sHy7TcVP5N2f+mbmgIo2WiH+vYruxcn/IZRpYFDi Qk4h/4mPxKZoYvFLcZguXclcxjjRp+p7Y1r2NpISWBBzXKXgweoeO8e0S4pQN1PUeuIy PGocWXJRsGE2O6J57QbYZbi5qnHoArtaWMI5QtjXCMY46HnZk+Vvcy72cT/dc/Vp0zL+ cQfQ== X-Forwarded-Encrypted: i=1; AJvYcCUMCXtQEQrNry2i5KBAvPfb3MJ0Z+DV0GoN+qpmw7INuH705eXGMiZ24j/ompD/4AeXUUc3qs43GqHrD63NDgL+gvN+fSXkgjahTZSY X-Gm-Message-State: AOJu0YztWZDjEWHMekzGm92qIYR3m63fupzRbzc+gg4174l+5IYXz6k8 n0Ot6/5CDabzG9/4XnjeDrSVKzSIGUvXzyzNPs3vU/MNslzSpYHyIAY8OgSrT4lsKqkJTHC7vXE = X-Received: by 2002:a05:6a20:2588:b0:1af:acb1:84bb with SMTP id adf61e73a8af0-1b26f16e881mr4242876637.4.1717201460336; Fri, 31 May 2024 17:24:20 -0700 (PDT) Received: from google.com ([2401:fa00:8f:203:b7f3:e557:e6df:620b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323e3d18sm22206425ad.179.2024.05.31.17.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 17:24:19 -0700 (PDT) Date: Sat, 1 Jun 2024 09:24:15 +0900 From: Sergey Senozhatsky To: Herbert Xu Cc: Sergey Senozhatsky , Linux Crypto Mailing List Subject: Re: [PATCH 1/3] crypto: scomp - Add setparam interface Message-ID: <20240601002415.GH8400@google.com> References: <84523e14722d0629b2ee9c8e7e3c04aa223c5fb5.1716202860.git.herbert@gondor.apana.org.au> <20240531054759.GE8400@google.com> <20240531063444.GG8400@google.com> Precedence: bulk X-Mailing-List: linux-crypto@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 (24/05/31 16:29), Herbert Xu wrote: > On Fri, May 31, 2024 at 03:34:44PM +0900, Sergey Senozhatsky wrote: > > > > So passing "raw" algorithm parameters to crypto_scomp_setparam(tfm) can be > > suboptimal, depending on the compression driver. For instance, for zstd > > (what is currently done in zram [1]) we pre-process "raw" parameters: > > parse dictionary in order to get zstd_cdict and zstd_ddict which are then > > shared by all tfm-s (as they access C/D dictionaries in read-only mode). > > For zram/zswap doing this per-tfm would result in extra per-CPU > > zstd_cdict/zstd_ddict allocations, which is a significant overhead. > > If they share the dictionary, why can't they just share the > tfm directly? Or do you actually need to vary the other parameters > while keeping the dictionary the same? Is it possible to share a tfm? I thought that tfm-s carry some state (compression workmem/scratch buffer) so one cannot do parallel compressions on different CPUs using the same tfm.