From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B79ABC021B8 for ; Wed, 26 Feb 2025 15:41:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E83128000E; Wed, 26 Feb 2025 10:41:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4710028000A; Wed, 26 Feb 2025 10:41:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3121928000E; Wed, 26 Feb 2025 10:41:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AADFE28000A for ; Wed, 26 Feb 2025 10:41:15 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 667701212E2 for ; Wed, 26 Feb 2025 15:41:14 +0000 (UTC) X-FDA: 83162509668.19.9D1BFED Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by imf30.hostedemail.com (Postfix) with ESMTP id 88F068000D for ; Wed, 26 Feb 2025 15:41:12 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=XTezM6xb; spf=pass (imf30.hostedemail.com: domain of sunk67188@gmail.com designates 209.85.160.194 as permitted sender) smtp.mailfrom=sunk67188@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740584472; a=rsa-sha256; cv=none; b=Ni+du4gazG3umw629zlwrPH0GzI3+DwzfU5zRCcLs73X9R7y+hsn9C+BUyZge/P3mYXg6D s/C28yK0IGp7RQ2fmijjzkRk583yFmnuMngGT0j+EKOOVwQ9eGxhTRQXR0hPprvJfwdBUf VEw5GxpKklEjGAPXx5xh6NaIFXeRzsg= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=XTezM6xb; spf=pass (imf30.hostedemail.com: domain of sunk67188@gmail.com designates 209.85.160.194 as permitted sender) smtp.mailfrom=sunk67188@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740584472; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+xGUi4PXKdPKbe0CNIpYFBrgT6fWDwBFrdfNzwwEDs0=; b=H+SAZIG61jVf66H9kIwcd/tmynvlSYcd5HXf2kE7jRH4oDjzVmLY1Yj8KTSDR4w4XUHf8c JtmljUNfZpign5X317MZincgMN42kkXbNAISr8va/d6w1nhBHZJ8WXjMC3o6g4ny38yUqX 0Q5vQ6K99i3if2q/rjawSOG1DhV9SnM= Received: by mail-qt1-f194.google.com with SMTP id d75a77b69052e-471f0cbb939so10931021cf.1 for ; Wed, 26 Feb 2025 07:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740584471; x=1741189271; darn=kvack.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+xGUi4PXKdPKbe0CNIpYFBrgT6fWDwBFrdfNzwwEDs0=; b=XTezM6xbNXQUP3N1dJgAuLDQ8KEjkXQIeLEGUC+E5GRMT96M0FREUYm5eI7coM3A3Q 7jRToQg+CO5cqBEKFVyObTH1tUq/xMIkxOGhvKXG/M6eRuWSwffYJC0Opi3FVMc30wx/ /252Zda7S6sjqtTHLRt7KhiyWw3w1JVkX0gag4hOUkdje2YtTmWwsWPqUZUfJ2l8JWay unLzCtUrWFX6tP8N8wHCHK+2AVFz5amX8aKWGt2lLk8GElOVuHpNUN42SwRU9DPP7m+0 R4z9VmleoNv7YytZK/QPGgM+mu95PwSmM1f4x1piUN0JerVHbRL85GFC5Zut8xJECIBJ afzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740584471; x=1741189271; h=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=+xGUi4PXKdPKbe0CNIpYFBrgT6fWDwBFrdfNzwwEDs0=; b=GCNMjyod3JvHxGrB6ZZc9espLGIrKU9DHEJpnCCjkStuOjR7aR8eckeSlGkRCWWPaH V9GHw3uEgNDts72Mzso6EXsAWlysGv7rFTQFfgnq1cVvwbx1Rj+UeTTI4xywghi0SV5y 9SpLnp9n9ZWglDa2zQIjChW/Oicd/2dLR7vcGYN4fJMKovwwiwE0NJM+uXoDO67BZo0d VMlzvOkue/ZBCLbkGGBkRt2xVSFFO4B+O8ML66YfxrRBVW8EVGu8Y+EnQhRb5eMz0VcJ ME/jH7UTuzRzCqX5KCisjic8DvEVVQuvHb7KtevnuPP1qLqZVVF/NEakl8BsmV3EP8cj 9xag== X-Forwarded-Encrypted: i=1; AJvYcCVHe/I++vJaeVtwXqduE96dFXV/yaAcSE6vgoavdbOstAtEYHV6WGWkSNJQem0SeKZL3TVjbcSNLQ==@kvack.org X-Gm-Message-State: AOJu0YzHpWnz9fwvRrYpkyvS0g6d/i6r9JQGcgDzc7IveiLWWWLHITRd y2bKFOtRvSji8ologM5i8XzzYv3CeaG/4elFPbZXW/6VG2yUykR4yKFOLhnaPiSH2KDqdsYghg/ nATRzu5dAghq/KnoKkO5wvHRGo3E= X-Gm-Gg: ASbGnctlY8qz7+61j3mHYsAOsC9BlpHByDJMC222bBTCQZj8Gxoa+GgeL9z2mzonmIR jxoYOiK9+j7dllNdZzhxhI8rKn9/Dojt9C6vgn5YxkdRR5PMRgk6s4T0Bi6nOCEuDzJ2kp9Nn6R a4tDlihxpfxfGI/X1tTfz/P7O3gY6v9/8MelyI X-Google-Smtp-Source: AGHT+IGA/eQtFmJ97eHqIl0XHgiR9RJcCZ0BLpk5e10CAMz05pOlScSY0OMOYPi6/gR25DY/aTlszroITEfdsqYUF54= X-Received: by 2002:a05:622a:2297:b0:472:17b5:dc3b with SMTP id d75a77b69052e-472229a5a94mr129397821cf.15.1740584471504; Wed, 26 Feb 2025 07:41:11 -0800 (PST) MIME-Version: 1.0 References: <20250226124141.22218-1-sunk67188@gmail.com> <20250226153253.19179-1-sunk67188@gmail.com> <2a4d6ef6-d7e5-46b9-a4ed-b7aad7a1c20d@redhat.com> In-Reply-To: <2a4d6ef6-d7e5-46b9-a4ed-b7aad7a1c20d@redhat.com> From: sun k Date: Wed, 26 Feb 2025 23:41:00 +0800 X-Gm-Features: AWEUYZlwiWCcpbfbB8UZe5pvWM0XUH2elIkAMVptZoNevXzUaXrogYCPLjPjdX4 Message-ID: Subject: Re: [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages To: David Hildenbrand Cc: yosry.ahmed@linux.dev, Johannes Weiner , Nhat Pham , Chengming Zhou , Andrew Morton , Kanchana P Sridhar , "open list:ZSWAP COMPRESSED SWAP CACHING" , open list Content-Type: multipart/alternative; boundary="0000000000002032d8062f0d6783" X-Stat-Signature: khm5squst6khx9kc5m4quhkoqbdw3d5i X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 88F068000D X-Rspam-User: X-HE-Tag: 1740584472-151305 X-HE-Meta: U2FsdGVkX18Y3q+x6C7on7aFmY40i6r2OAHLwbeBbftwdpWfC3l2yJyiQIsO4UEhbX4qDocoYG5+SrgUze1G5TkaI8hpihTz+Mu+rx95MGp+RXF3LzGeNGmBzZDguIPF6R9ydkODs5fNY4xXp03gbj8tyoisbJ/5akuzKFnTlLlNOqyYZ2EY6Gi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MACBApJEZa7zMKAldiRNVV9bbauEcssI7YAu0r/XXiAvhLIXRhEQwICAKofuu6+/Ygi4lH9/VRivf2jq3xBHvoNPWYTsDdlbhZ8eAiYrLxYeQ8JCLdwxZGkHbXGugGiHOOpstLq2g/9uIzLVwc5XM2N2pcZ7gC1Qo6mANMi9xp1UjtYLXZTxmOxe4WLuBnagpfmlsnwDab9ndA3Xx6u/xKMtyN2qwAYwJQ1IYN5IQNlgEUoL9H22XoY5QFuSG+9WlU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001083, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --0000000000002032d8062f0d6783 Content-Type: text/plain; charset="UTF-8" Very helpful! Thanks for the tips! On Wed, Feb 26, 2025, 11:39 PM David Hildenbrand wrote: > On 26.02.25 16:32, Sun YangKai wrote: > > Something for the future: if you send a v2, indicate that in the patch > subject ("[PATCH v2]") and ideally, describe the change since v1 under > the "---", and don't send it as reply to the original patch. > > > > This is currently the only atomic_long_t variable initialized by > > ATOMIC_INIT macro found in the kernel by using > > `grep -r atomic_long_t | grep ATOMIC_INIT` > > > > This was introduced in 6e1fa555ec77, in which we modified > > the correct way to reference to commits ids even in text is the format > you use below. > > But here it's sufficient to not be repetitive and simply say > > "We changed the type of zswap_stored_pages to be an atomic_long_t, but > didn't change the initialization." > > Acked-by: David Hildenbrand > > > the type of zswap_stored_pages to atomic_long_t, > > but didn't change the initialization. > > > > Fixes: 6e1fa555ec77 ("mm: zswap: modify zswap_stored_pages to be > atomic_long_t") > > Signed-off-by: Sun YangKai > > --- > > mm/zswap.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/zswap.c b/mm/zswap.c > > index ac9d299e7d0c..23365e76a3ce 100644 > > --- a/mm/zswap.c > > +++ b/mm/zswap.c > > @@ -43,7 +43,7 @@ > > * statistics > > **********************************/ > > /* The number of compressed pages currently stored in zswap */ > > -atomic_long_t zswap_stored_pages = ATOMIC_INIT(0); > > +atomic_long_t zswap_stored_pages = ATOMIC_LONG_INIT(0); > > > > /* > > * The statistics below are not protected from concurrent access for > > > -- > Cheers, > > David / dhildenb > > --0000000000002032d8062f0d6783 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Very helpful! Thanks for the tips!


On Wed= , Feb 26, 2025, 11:39 PM David Hildenbrand <david@redhat.com> wrote:
On 26.02.25 16:32, Sun YangKai wrote:

Something for the future: if you send a v2, indicate that in the patch
subject ("[PATCH v2]") and ideally, describe the change since v1 = under
the "---", and don't send it as reply to the original patch.<= br>

> This is currently the only atomic_long_t variable initialized by
> ATOMIC_INIT macro found in the kernel by using
> `grep -r atomic_long_t | grep ATOMIC_INIT`
>
> This was introduced in 6e1fa555ec77, in which we modified

the correct way to reference to commits ids even in text is the format
you use below.

But here it's sufficient to not be repetitive and simply say

"We changed the type of zswap_stored_pages to be an atomic_long_t, but=
didn't change the initialization."

Acked-by: David Hildenbrand <david@redhat.com>

> the type of zswap_stored_pages to atomic_long_t,
> but didn't change the initialization.
>
> Fixes: 6e1fa555ec77 ("mm: zswap: modify zswap_stored_pages to be = atomic_long_t")
> Signed-off-by: Sun YangKai <sunk67188@gmail.com>
> ---
>=C2=A0 =C2=A0mm/zswap.c | 2 +-
>=C2=A0 =C2=A01 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index ac9d299e7d0c..23365e76a3ce 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -43,7 +43,7 @@
>=C2=A0 =C2=A0* statistics
>=C2=A0 =C2=A0**********************************/
>=C2=A0 =C2=A0/* The number of compressed pages currently stored in zswa= p */
> -atomic_long_t zswap_stored_pages =3D ATOMIC_INIT(0);
> +atomic_long_t zswap_stored_pages =3D ATOMIC_LONG_INIT(0);
>=C2=A0 =C2=A0
>=C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 * The statistics below are not protected from concurrent = access for


--
Cheers,

David / dhildenb

--0000000000002032d8062f0d6783--