Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1907409rdb; Mon, 8 Jan 2024 14:37:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzlq+ag1D9XxqmUqQcvynDigH2sA2ozjbTqxK2KqijGM9KLzr/QQVocFnulyQfoYrc+lO/ X-Received: by 2002:a05:6214:20ac:b0:67f:b99a:e98e with SMTP id 12-20020a05621420ac00b0067fb99ae98emr6019358qvd.77.1704753446816; Mon, 08 Jan 2024 14:37:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704753446; cv=none; d=google.com; s=arc-20160816; b=hfEDjzfNw/z0AZAqKDA82HRkAydfKMetjJ8tLYVHrfNfQgo6IoCK7BK7QRV0FUWm9x 268gQ9J7Nn7FhHFxencchpTui8LYM+87n+qJdN+4iybhI/nOrrFjgvUf+aljqkKec1zF 3UsFMbSQiCbDB2SwnXIeNw44XaYEB4oN6rMdMFq7QqSGadSelyVuCf48+a1nNQwCuowQ lwvmmyrvyIEuiQjKy1UzIvqbb0vU3Z18u6dTlt641alqS55sas8dYMdGIWrnBiUqrRGY PS7XcwQeTzeJOU4m4YVV6QXJLwysS1IJaXI3exhuOKHrajP8OzJlXeHdW7xglF/BHEA9 XHlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=P0Wg2B2xBGG1Cu5qs0eAgovYqyf38el6XsD5yrJOGPM=; fh=l+cygn1PPm3qGa+e+Z3D2zZ334R4MQjWnH/dWWBdqTE=; b=GXVYLDbTYbf9b6eiMzcwaaGDk+3KhDZccpxCeXYc0DHZiQv1EtXHVf6AMYcRTbGybP uFvqNXJDVy3ISy3gJGPm676q/wx/dWJl/GLy7uZR6AvYGjQnjS5kNMVX/fxV0p1UjFHw 3BAbriUyj3sP10iwbdmSnxs05ifg3UZViAxuw/JIe2SdIFKekrYtmL8q8X7X2EgLvL6B 0txGp99nL8jipCLctv36vBFoaP1GclqtYszQN/fu4o1P6VKqIGigByemPRlChmi+6oQ8 t+a88DJbckCaSgH1Ooq14nI+r/hoGq8ilqfUmPt9dmbzMVgzo7HuuepSapf3B5d+lHMh mQ0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Yiwt5CWH; spf=pass (google.com: domain of linux-crypto+bounces-1289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d13-20020a0cf0cd000000b0067f87ec5937si864710qvl.503.2024.01.08.14.37.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 14:37:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-1289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Yiwt5CWH; spf=pass (google.com: domain of linux-crypto+bounces-1289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-1289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 7F2071C22E45 for ; Mon, 8 Jan 2024 22:37:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 915E2BE4E; Mon, 8 Jan 2024 22:37:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Yiwt5CWH" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 D980D2904 for ; Mon, 8 Jan 2024 22:37:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-55745901085so2875161a12.0 for ; Mon, 08 Jan 2024 14:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704753438; x=1705358238; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=P0Wg2B2xBGG1Cu5qs0eAgovYqyf38el6XsD5yrJOGPM=; b=Yiwt5CWH3nkEHhaGFdeieca7mKwuEGJDWQD3qamdLvdciNQt12IhdTgDtuuCPsfSud zbzVZ6uQItnEnduwhfoW6s0SBe0SCtfq6QlrIz5NYZUCX3nGhVobsmJ+EYyHoGTL5SP/ Hr5rOYnNnNa2vk3x9k1bwV4YoTU4WehUc6sVZOGYpVCYNLdbeEuvCUW5jWJB7DUrYIfJ L3sU/HEAQDkZXG3xel6kN+mRotyeOXxf+UJ4uAa7G8YMI2oHUYn4/VAS9scIXq8d/3wV EGRLfxbRUUbbpASsfRvnx8thMP0JoooMTOiyjcz/0jFbiOnc1jpFL0CDhA5wC8F46E37 n/Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704753438; x=1705358238; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P0Wg2B2xBGG1Cu5qs0eAgovYqyf38el6XsD5yrJOGPM=; b=Kuz4BiIrParvmaLfyuv3DYI9DgUrWxHQrf/vx/YWQSGl4PUEM9vvxWCRvXVpibnIhD VK8MsjGGyJNx5f5puMT7Dhahx7GXjrTKGBLC8790JWW86zOSJL9HVQ9k6z3ZQ6nKfmZ0 U1h2u6UEaxyDbT8VG2kFt8JvcR2/Xc9a0NDgsRmlS+xRc9WfTe4CdXU5cZqzyPkWbosN FNSSRTdjNKFHWUy09naVKLgNHaZokCFJ6XmOT2r+pjIxna9gKkCdVl42PoZU4w6Vn3Zl jPmXcN/ysJXJbQQoFhybP5vxP/JnQ8hUwLatNhEs1KyiCplNEO6N8F/5eatS+jks8sRu rQMQ== X-Gm-Message-State: AOJu0Ywuv2QzNgWgCHzRqY4evsRhcgt9pgcKpuKXGQGnnUF98TxO2yTr Al1bcDSxlzaM2Fjgori+5iIaBC/hVLy3DOROmLKvsl/0pfFd X-Received: by 2002:a17:906:dac8:b0:a1f:99dd:15a3 with SMTP id xi8-20020a170906dac800b00a1f99dd15a3mr77902ejb.107.1704753438108; Mon, 08 Jan 2024 14:37:18 -0800 (PST) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240103095006.608744-1-21cnbao@gmail.com> <20240103095006.608744-3-21cnbao@gmail.com> In-Reply-To: <20240103095006.608744-3-21cnbao@gmail.com> From: Yosry Ahmed Date: Mon, 8 Jan 2024 14:36:41 -0800 Message-ID: Subject: Re: [PATCH 2/3] mm/zswap: remove the memcpy if acomp is not asynchronous To: Barry Song <21cnbao@gmail.com> Cc: herbert@gondor.apana.org.au, davem@davemloft.net, akpm@linux-foundation.org, ddstreet@ieee.org, sjenning@redhat.com, vitaly.wool@konsulko.com, linux-crypto@vger.kernel.org, chriscli@google.com, chrisl@kernel.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, nphamcs@gmail.com, zhouchengming@bytedance.com, Barry Song Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 3, 2024 at 1:50=E2=80=AFAM Barry Song <21cnbao@gmail.com> wrote= : > > From: Barry Song > > Most compressors are actually CPU-based and won't sleep during > compression and decompression. We should remove the redundant > memcpy for them. > > Signed-off-by: Barry Song > Tested-by: Chengming Zhou > --- > mm/zswap.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/mm/zswap.c b/mm/zswap.c > index ca25b676048e..36898614ebcc 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c > @@ -168,6 +168,7 @@ struct crypto_acomp_ctx { > struct crypto_wait wait; > u8 *buffer; > struct mutex mutex; > + bool is_async; /* if acomp can sleep */ As pointed out in patch 1, I think we should name this explicitly to be about sleep-ability (e.g. sleepable or can_sleep).