Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1373204lqa; Mon, 29 Apr 2024 06:57:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFUFEGfceTRWN4dZ4UA4/o8CF2jYPBFhy6+nQ70MCt9WJc5ylksEl+eF4RM21wUVkbhbPSmbUGAGygVzXs1HRwg9vM1GQ04zAuBzA6Wg== X-Google-Smtp-Source: AGHT+IGx5l7bHFQpGJUck2NlyyVTra6ec90UL8MuQcT98jJG/ZuBuP7jTr3f/Vgh8Tpp+JxatJ0u X-Received: by 2002:ac2:4542:0:b0:51c:66eb:8a66 with SMTP id j2-20020ac24542000000b0051c66eb8a66mr5705955lfm.67.1714399064528; Mon, 29 Apr 2024 06:57:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714399064; cv=pass; d=google.com; s=arc-20160816; b=GkViQCkEmLONpCY6iBdxtXYfu1fG3+GDal3xYerIAfZvgqYNqF83R8LCBhk3YDPwW8 nosPUgBfK5D7L7IUaweeZtz4L13cpZKtSeX7zDW3HhHxEiYJE6wgvVhUSK0zEjrADMp0 YubfXOGo3GuZob6HkN73rJaPaHBgDlHk1jg5bBForqC9BWyN0/Bl5YtDM8MRSahShZXx wg1o5+x1Eb0x/pSUGOes3JDSg24l83ABoZ2dNZK0rjn1M+K7ttoewAXZdwctIbFqx9OF IpJxN21UUR9fXAdkSH6B1735d7ywk5i1ToQsisFchphX76eRMzyaFau+hGbehgFH08yh dixg== 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=01lzr/lJoBv5oeL/0n6BTxidXs2hC7B3SVPcnUULo6Q=; fh=vd+hssTMNQSeCroalwlSntT+2NrYzyb9HcBRNxy5Nkw=; b=kn5BhoYYMLgfVi4v6KfWy+DTaNCH+Bz1zKug9mxuYIbMCb8qBx0Jut+tckSDC1T5su iRX2N+tpryCr4ef9b48XL8DMeLIgoaO7WNlinsqTcETEaW6FEyrzL/GMe/VgZoaWgNMN iw0CngFqYSybcoF2h6NjeIp/OKlc6VYkFXr3wkf+cgrhrbpSSo9FOmTVUpd4u45bC0mT 40VOaOb6ChLq8udiXFoa6zMiTKNKS0WfJPy0gfN0fVCQh2V76bXeLJV0l6UCTpZCb2oR orOm9EACOSubgF1BOd4lQoGToQFAUGSlX7Kp5ulkvyBr+NlOtdxFzCfY9gceLLtF4ijk htWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=UX7II4Yu; arc=pass (i=1 dkim=pass dkdomain=toxicpanda-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-crypto+bounces-3928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3928-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a7-20020a509b47000000b0057279138184si2225907edj.4.2024.04.29.06.57.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=UX7II4Yu; arc=pass (i=1 dkim=pass dkdomain=toxicpanda-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-crypto+bounces-3928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3928-linux.lists.archive=gmail.com@vger.kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 350711F2206D for ; Mon, 29 Apr 2024 13:56:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7BD574BF5; Mon, 29 Apr 2024 13:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="UX7II4Yu" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) (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 73D6C745C0 for ; Mon, 29 Apr 2024 13:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714399008; cv=none; b=dqKUqXV1Lcxl9ADD2H0fMbM5rkVPt9OJSTcYPS+ZZtr4NuqXVsw0dOH/Xty1klgZijlbk6omCMVzA0alF4HihwlqUaZOKp7J6UX2ZJweUlB/vpbnkWs48zl+gQBxqX8dUuOP7WUct3YkfYWrUh8qmDKGqsAkC3QK4N5tOtPh6GE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714399008; c=relaxed/simple; bh=920U7DhlCUqfILbwgxP5ucHFht1rUv0oUKZBQeo6VjA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AnPYGxwI2KjCiNVZkD+mFF137lNIhNuko+yH5UQ3ct9g+ORFYZ2KT+DADtAR/xTgN+OuV+mblss/DUUtXD2IOXF+sIRPXpYgBpGaTd3CAlsuSgalDIhj9OOMyhkdIeIxEK8uk/xdv6IfNVQEY6Ks2/RI2+IKcWrdpcUQd/Xg6Qk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=UX7II4Yu; arc=none smtp.client-ip=209.85.161.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-5aa27dba8a1so2773584eaf.0 for ; Mon, 29 Apr 2024 06:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1714399006; x=1715003806; 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=01lzr/lJoBv5oeL/0n6BTxidXs2hC7B3SVPcnUULo6Q=; b=UX7II4YuOOj1K8GuVk1GP6p7nUgH3JjbiwuP+KiFC1LA9Z7a9fWUOg9OMtdhKY6zi0 9jjlT59lytMlnjM94ax5sDz+Rl7uSTxDgamhGw7SocNuivIIugOx43iZeLIZ2DhiiWzt QbWqBnBMfR0jVNUFDi4dcn40SpaSN3YytblB56RSDFuFCbjQChs/q3IKQ8SN3BQd26+Q 6kdGqFsebFe7oizShjA8fZbGwKsELip336ITj2sUrQMsjV+zk2ML8/KIPl71bOpSRBdP zeAKaAum20S5nGswB3/MJ5bsHeJqbqhrmGrmXKXIVq72qSlBc46BAjpRG3kzt7zPPt/E z6DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714399006; x=1715003806; 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=01lzr/lJoBv5oeL/0n6BTxidXs2hC7B3SVPcnUULo6Q=; b=SNgNacjh+zk6v8guvv7Ke3047SIebVGdAvZ4lwiciaGPmngwUC8EPPgGeonrEvaY8+ a+/z4Iqt6FXcZ1NuTLqdnZg/MW1eEYNbO7K5Gv86XRNCtkf4Of/PboNKd5LjGKXcEtLi rMp4hxSVycKS540cg6gimhfkzjSM8WweeB9rg3j13JhLENKLzM1kLanPdPL8oQm9MvlJ cRcfVny2OzsMJ1hogiQVLH6SBgvLwm4hMFBWRoI1Mjq7Uewk2ITms3HWpHA75o9ZvdOi n4+zddiumNmHi+5kqUwgewsuEQQUQ/Fpb5FlgvSN+uzW4g1JUmlRs3SeYIshfDth70Vx kQGw== X-Forwarded-Encrypted: i=1; AJvYcCUG1EEMYwkz3h1w0GQsZjEY/7Gszq/5aGzJpbdqZiX02XNleehRV+WHSXR7WSn845E9PB5lCW/Yt/P+aZpXpfRj2IYbhTJuHxOFT1kB X-Gm-Message-State: AOJu0Yzk4VVOO5UpCphcCOI1CXbdVVkNDFKGDap2SRJTOjVsAI1RJi0s wOulgPeGCoe9Gq1nkQTDvROGxSHIfyVbYX/NUF1m+k9d3XbRyTF/+fL62dTCdj8= X-Received: by 2002:a05:6358:3913:b0:18b:9051:3cc with SMTP id y19-20020a056358391300b0018b905103ccmr10614669rwd.17.1714399006341; Mon, 29 Apr 2024 06:56:46 -0700 (PDT) Received: from localhost ([76.182.20.124]) by smtp.gmail.com with ESMTPSA id k4-20020a056214024400b006a0d057073bsm800256qvt.58.2024.04.29.06.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:56:45 -0700 (PDT) Date: Mon, 29 Apr 2024 09:56:45 -0400 From: Josef Bacik To: Giovanni Cabiddu Cc: clm@fb.com, dsterba@suse.com, herbert@gondor.apana.org.au, linux-btrfs@vger.kernel.org, linux-crypto@vger.kernel.org, qat-linux@intel.com, embg@meta.com, cyan@meta.com, brian.will@intel.com, weigang.li@intel.com Subject: Re: [RFC PATCH 6/6] btrfs: zlib: add support for zlib-deflate through acomp Message-ID: <20240429135645.GA3288472@perftesting> References: <20240426110941.5456-1-giovanni.cabiddu@intel.com> <20240426110941.5456-7-giovanni.cabiddu@intel.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: <20240426110941.5456-7-giovanni.cabiddu@intel.com> On Fri, Apr 26, 2024 at 11:54:29AM +0100, Giovanni Cabiddu wrote: > From: Weigang Li > > Add support for zlib compression and decompression through the acomp > APIs. > Input pages are added to an sg-list and sent to acomp in one request. > Since acomp is asynchronous, the thread is put to sleep and then the CPU > is freed up. Once compression is done, the acomp callback is triggered > and the thread is woke up. > > This patch doesn't change the BTRFS disk format, this means that files > compressed by hardware engines can be de-compressed by the zlib software > library, and vice versa. > > Limitations: > * The implementation tries always to use an acomp even if only > zlib-deflate-scomp is present > * Acomp does not provide a way to support compression levels That's a non-starter. We can't just lie to the user about the compression level that is being used. If the user just does "-o compress=zlib" then you need to update btrfs_compress_set_level() to figure out the compression level that acomp is going to use and set that appropriately, so we can report to the user what is actually being used. Additionally if a user specifies a compression level you need to make sure we don't do acomp if it doesn't match what acomp is going to do. Finally, for the normal code review, there's a bunch of things that need to be fixed up before I take a closer look - We don't use pr_(), we have btrfs specific printk helpers, please use those. - We do 1 variable per line, fix up the variable declarations in your functions. Thanks, Josef