Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4010219rdb; Thu, 28 Dec 2023 07:19:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4oCYb896b2kYTop26vF0FliFWYRjM6eLjquHTAyYBcJby9rFlxtlQonRPRsrkSH8I8yI4 X-Received: by 2002:a05:600c:4443:b0:40d:3f5b:8283 with SMTP id v3-20020a05600c444300b0040d3f5b8283mr5903945wmn.37.1703776795847; Thu, 28 Dec 2023 07:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703776795; cv=none; d=google.com; s=arc-20160816; b=Iu/oK4XSZ8gTkzVdg5mTO6FgWG8BPzR3QgXzruSPnh3LJwLh/Prx4T1+LOG7W4w8Sv kMGQzu6/oRA/6oRUMxY+rwpYxpqL81iKNfuQAB7lwy5kZ6/lOR5xM/bL5fCdTloq6eMa pcvPIJ1L3BZaV1mvlXDAQOa69PUWy1dXVMue8gtwuQHvHPHdDwm8Bv/rzlAtc4gmLOVT M0uua9cqgRHhIxN6NmFT+Xji5qybrzqDyEpxrtAW1e5kVcXRhV5Nt4bJtVJ3kD0qFkKJ Nbn5epMpJ1GFH24aDNmb9sAfdnYrjB3GU/66StemlVgHNJQ5mT0R/HCHux74XE5vV/jo lI3A== 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=8Ha+pAOWsoDIh9rt3FhMOiZJHiegkUy/cwMrNu3tQCw=; fh=X7Oh63Os35YudGc3Z+XZfx+5mhjtJ0bV/93oPBTQi2w=; b=VUl201ZFhPhFKSvHEoujdZKYgkMT4Kzw0Tt/9YWajh+TtcdDx8UymfEWebmaR6bcF2 msROAUJelvUKL+qN5+eLzovAmZ+ELsPn3XXAnqJvw4w2iFAomX5AvwYoiEt8/RWP/3NW BOEEOjHha4NcmSNmkTDFFUU0OTMzK0L98rdJrUBStCWHdag4hzXR7WXhq5urfg8dxX+b MFI7vbNBDO3h+oZo6VQFXu7MjH847MId5pFxkHqdBpRyjX8efJdLP026I48DsoXsYuoZ ZoX9ghuu1Eq7liUTrYyP0+0RK+tOo3I7eci0RvPpFjEsm1nsTFoIY8YFp+i/ND5qCuvc P9cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=W8iJNXoZ; spf=pass (google.com: domain of linux-kernel+bounces-12749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12749-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gl24-20020a170906e0d800b00a1d330e5e3asi7119466ejb.793.2023.12.28.07.19.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 07:19:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12749-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=@google.com header.s=20230601 header.b=W8iJNXoZ; spf=pass (google.com: domain of linux-kernel+bounces-12749-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12749-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 978071F24424 for ; Thu, 28 Dec 2023 15:19:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62C0FF4FA; Thu, 28 Dec 2023 15:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="W8iJNXoZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 0C2CFF4E7 for ; Thu, 28 Dec 2023 15:19:46 +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-lf1-f49.google.com with SMTP id 2adb3069b0e04-50e7aed09adso3555557e87.0 for ; Thu, 28 Dec 2023 07:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703776785; x=1704381585; 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=8Ha+pAOWsoDIh9rt3FhMOiZJHiegkUy/cwMrNu3tQCw=; b=W8iJNXoZsT5Zl76aQtyUJ/vpVAZBaTmp/LrV+HOIYpAxsxyn1S4mlig4MqykBoDesl zUhSh7JGPING5uUohfG/fsuZAu1zZvgtIk1r2hzihvEsARKc4xYr9ISJdMBujuBKSiun zpaegR2Mpff7IIw3vhNMs/xFUTAt8fiQ258oC8JAvJdZrTxBzKk/p5HdJdmNUqmJedV+ UnE9gmbK6Lzle3GXryE/MIOFPRsscam9FTyRGB/jT7EGhO/hlDqOq/cWHpQHdDDTcBAf RKzNlbxp/V7lVcTlPPIJsQW0oMFpnfRcR5y4yYzabd5UpToZCn2NHarbokhwoNkZg3eM rJVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703776785; x=1704381585; 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=8Ha+pAOWsoDIh9rt3FhMOiZJHiegkUy/cwMrNu3tQCw=; b=NYMu7/8tTInafRhc1hNEyAGyCbdKUiiPtEFUwvZ35/kOUJcd7li9Elu/nHvKAd40Cz DzTyr4Q6A/no2KN/mDOJg3k5jbR6RZZTmtGAZkYg6QHwaKDeiJOgL3hr5TrV170QDnDd iOMSLpcNt6qkCbnFDcG+kuuDPYrB01GXZKBQklOwzo2lx+rqJJUWElNKbwsGnfllOyqP +BmmXqzkPe+O5JsSd8ZLDyV8kZch0Trth9zk92pLjtPgKN2fq2IsflvvXc/VKmbKLPyp HERZytjgL1qk3j5vZZ+w235iJTOnrOpwwtneho7zSPtPKZziR3feZvKA0n/dawmBCJ/a qF0Q== X-Gm-Message-State: AOJu0Yyb9RjuTb1IAaDVshxg3fMe/snECvdkL6w5xVOBQk5rQupb4lSg dcN0enzImzk2kCdV6RJsxxCZw3NUvaL9RW4cPnTnVS0M7d6K X-Received: by 2002:a05:6512:1329:b0:50e:8ccc:6df5 with SMTP id x41-20020a056512132900b0050e8ccc6df5mr554370lfu.27.1703776784726; Thu, 28 Dec 2023 07:19:44 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231213-zswap-dstmem-v5-0-9382162bbf05@bytedance.com> <20231213-zswap-dstmem-v5-5-9382162bbf05@bytedance.com> In-Reply-To: <20231213-zswap-dstmem-v5-5-9382162bbf05@bytedance.com> From: Yosry Ahmed Date: Thu, 28 Dec 2023 07:19:08 -0800 Message-ID: Subject: Re: [PATCH v5 5/5] mm/zswap: change per-cpu mutex and buffer to per-acomp_ctx To: Chengming Zhou Cc: Barry Song <21cnbao@gmail.com>, Nhat Pham , Andrew Morton , Dan Streetman , Vitaly Wool , Johannes Weiner , Chris Li , Seth Jennings , Chris Li , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 28, 2023 at 1:46=E2=80=AFAM Chengming Zhou wrote: > > First of all, we need to rename acomp_ctx->dstmem field to buffer, > since we are now using for purposes other than compression. > > Then we change per-cpu mutex and buffer to per-acomp_ctx, since > them belong to the acomp_ctx and are necessary parts when used > in the compress/decompress contexts. > > So we can remove the old per-cpu mutex and dstmem. > > Acked-by: Chris Li (Google) > Reviewed-by: Nhat Pham > Signed-off-by: Chengming Zhou Instead of hardcoding PAGE_SIZE * 2 multiple times, can we define a constant for this and document the need for the buffer size there? Even better if that constant is based on WORST_COMPR_FACTOR and shared between zswap and zram -- but this can be a follow up change.