* [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages
@ 2025-02-26 12:41 Sun YangKai
2025-02-26 15:15 ` Yosry Ahmed
2025-02-26 15:32 ` Sun YangKai
0 siblings, 2 replies; 5+ messages in thread
From: Sun YangKai @ 2025-02-26 12:41 UTC (permalink / raw)
To: nphamcs
Cc: Sun YangKai, Johannes Weiner, Yosry Ahmed, Chengming Zhou,
Andrew Morton, Kanchana P Sridhar,
open list:ZSWAP COMPRESSED SWAP CACHING, open list
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 6e1fa55, in which we modified
the type of zswap_stored_pages to atomic_long_t,
but didn't change the initialization.
Fixes: 6e1fa55 ("mm: zswap: modify zswap_stored_pages to be atomic_long_t")
Signed-off-by: Sun YangKai <sunk67188@gmail.com>
---
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
--
2.48.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages
2025-02-26 12:41 [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages Sun YangKai
@ 2025-02-26 15:15 ` Yosry Ahmed
2025-02-26 15:32 ` Sun YangKai
1 sibling, 0 replies; 5+ messages in thread
From: Yosry Ahmed @ 2025-02-26 15:15 UTC (permalink / raw)
To: Sun YangKai
Cc: nphamcs, Johannes Weiner, Chengming Zhou, Andrew Morton,
Kanchana P Sridhar, open list:ZSWAP COMPRESSED SWAP CACHING,
open list
On Wed, Feb 26, 2025 at 08:41:39PM +0800, Sun YangKai wrote:
> 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 6e1fa55, in which we modified
We use the first 12 characters in the SHA1 to minimize collisions (same
in 'Fixes' below), so both should be 6e1fa555ec77.
> the type of zswap_stored_pages to atomic_long_t,
> but didn't change the initialization.
>
> Fixes: 6e1fa55 ("mm: zswap: modify zswap_stored_pages to be atomic_long_t")
> Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>
> ---
> 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
> --
> 2.48.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages
2025-02-26 12:41 [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages Sun YangKai
2025-02-26 15:15 ` Yosry Ahmed
@ 2025-02-26 15:32 ` Sun YangKai
2025-02-26 15:39 ` David Hildenbrand
1 sibling, 1 reply; 5+ messages in thread
From: Sun YangKai @ 2025-02-26 15:32 UTC (permalink / raw)
To: yosry.ahmed
Cc: Sun YangKai, Johannes Weiner, Nhat Pham, Chengming Zhou,
Andrew Morton, Kanchana P Sridhar,
open list:ZSWAP COMPRESSED SWAP CACHING, open list
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 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>
---
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
--
2.48.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages
2025-02-26 15:32 ` Sun YangKai
@ 2025-02-26 15:39 ` David Hildenbrand
2025-02-26 15:41 ` sun k
0 siblings, 1 reply; 5+ messages in thread
From: David Hildenbrand @ 2025-02-26 15:39 UTC (permalink / raw)
To: Sun YangKai, yosry.ahmed
Cc: Johannes Weiner, Nhat Pham, Chengming Zhou, Andrew Morton,
Kanchana P Sridhar, open list:ZSWAP COMPRESSED SWAP CACHING,
open list
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 <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>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages
2025-02-26 15:39 ` David Hildenbrand
@ 2025-02-26 15:41 ` sun k
0 siblings, 0 replies; 5+ messages in thread
From: sun k @ 2025-02-26 15:41 UTC (permalink / raw)
To: David Hildenbrand
Cc: yosry.ahmed, Johannes Weiner, Nhat Pham, Chengming Zhou,
Andrew Morton, Kanchana P Sridhar,
open list:ZSWAP COMPRESSED SWAP CACHING, open list
[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]
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.
>
>
> > 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>
> > ---
> > 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
>
>
[-- Attachment #2: Type: text/html, Size: 2517 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-02-26 15:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-26 12:41 [PATCH] mm: zswap: use ATOMIC_LONG_INIT to initialize zswap_stored_pages Sun YangKai
2025-02-26 15:15 ` Yosry Ahmed
2025-02-26 15:32 ` Sun YangKai
2025-02-26 15:39 ` David Hildenbrand
2025-02-26 15:41 ` sun k
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox