All of lore.kernel.org
 help / color / mirror / Atom feed
* + zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch added to mm-unstable branch
@ 2023-02-26  4:31 Andrew Morton
  2023-02-26  9:48 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2023-02-26  4:31 UTC (permalink / raw)
  To: mm-commits, senozhatsky, minchan, axboe, geert+renesas, akpm


The patch titled
     Subject: zram: use atomic_long_read() to read atomic_long_t
has been added to the -mm mm-unstable branch.  Its filename is
     zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Geert Uytterhoeven <geert+renesas@glider.be>
Subject: zram: use atomic_long_read() to read atomic_long_t
Date: Sat, 25 Feb 2023 13:15:23 +0100

On 32-bit:

    drivers/block/zram/zram_drv.c: In function `mm_stat_show':
    drivers/block/zram/zram_drv.c:1234:23: error: passing argument 1 of `atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
     1234 |    (u64)atomic64_read(&pool_stats.objs_moved));
	  |                       ^~~~~~~~~~~~~~~~~~~~~~
	  |                       |
	  |                       atomic_long_t * {aka struct <anonymous> *}
    In file included from ./include/linux/atomic.h:82,
		     from ./include/linux/mm_types_task.h:13,
		     from ./include/linux/mm_types.h:5,
		     from ./include/linux/buildid.h:5,
		     from ./include/linux/module.h:14,
		     from drivers/block/zram/zram_drv.c:18:
    ./include/linux/atomic/atomic-instrumented.h:644:33: note: expected `const atomic64_t *' {aka `const struct <anonymous> *'} but argument is of type `atomic_long_t *' {aka `struct <anonymous> *'}
      644 | atomic64_read(const atomic64_t *v)
	  |               ~~~~~~~~~~~~~~~~~~^

Fix this by using atomic_long_read() instead.

Link: https://lkml.kernel.org/r/20230225121523.3288544-1-geert+renesas@glider.be
Fixes: b7d89654a988a2a4 ("zram: show zsmalloc objs_moved stat in mm_stat")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reported-by; <noreply@ellerman.id.au>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---


--- a/drivers/block/zram/zram_drv.c~zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix
+++ b/drivers/block/zram/zram_drv.c
@@ -1221,7 +1221,7 @@ static ssize_t mm_stat_show(struct device *dev,
 	max_used = atomic_long_read(&zram->stats.max_used_pages);
 
 	ret = scnprintf(buf, PAGE_SIZE,
-			"%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu %8llu\n",
+			"%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu %8lu\n",
 			orig_size << PAGE_SHIFT,
 			(u64)atomic64_read(&zram->stats.compr_data_size),
 			mem_used << PAGE_SHIFT,
@@ -1231,7 +1231,7 @@ static ssize_t mm_stat_show(struct device *dev,
 			atomic_long_read(&pool_stats.pages_compacted),
 			(u64)atomic64_read(&zram->stats.huge_pages),
 			(u64)atomic64_read(&zram->stats.huge_pages_since),
-			(u64)atomic64_read(&pool_stats.objs_moved));
+			atomic_long_read(&pool_stats.objs_moved));
 	up_read(&zram->init_lock);
 
 	return ret;
_

Patches currently in -mm which might be from geert+renesas@glider.be are

zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: + zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch added to mm-unstable branch
  2023-02-26  4:31 + zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch added to mm-unstable branch Andrew Morton
@ 2023-02-26  9:48 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2023-02-26  9:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, senozhatsky, minchan, axboe, geert+renesas

Hi Andrew,

On Sun, Feb 26, 2023 at 5:31 AM Andrew Morton <akpm@linux-foundation.org> wrote:
> The patch titled
>      Subject: zram: use atomic_long_read() to read atomic_long_t
> has been added to the -mm mm-unstable branch.  Its filename is
>      zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch
>
> This patch will shortly appear at
>      https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch
>
> This patch will later appear in the mm-unstable branch at
>     git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
>
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
>
> The -mm tree is included into linux-next via the mm-everything
> branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> and is updated there every 2-3 working days
>
> ------------------------------------------------------
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Subject: zram: use atomic_long_read() to read atomic_long_t
> Date: Sat, 25 Feb 2023 13:15:23 +0100
>
> On 32-bit:
>
>     drivers/block/zram/zram_drv.c: In function `mm_stat_show':
>     drivers/block/zram/zram_drv.c:1234:23: error: passing argument 1 of `atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
>      1234 |    (u64)atomic64_read(&pool_stats.objs_moved));
>           |                       ^~~~~~~~~~~~~~~~~~~~~~
>           |                       |
>           |                       atomic_long_t * {aka struct <anonymous> *}
>     In file included from ./include/linux/atomic.h:82,
>                      from ./include/linux/mm_types_task.h:13,
>                      from ./include/linux/mm_types.h:5,
>                      from ./include/linux/buildid.h:5,
>                      from ./include/linux/module.h:14,
>                      from drivers/block/zram/zram_drv.c:18:
>     ./include/linux/atomic/atomic-instrumented.h:644:33: note: expected `const atomic64_t *' {aka `const struct <anonymous> *'} but argument is of type `atomic_long_t *' {aka `struct <anonymous> *'}
>       644 | atomic64_read(const atomic64_t *v)
>           |               ~~~~~~~~~~~~~~~~~~^
>
> Fix this by using atomic_long_read() instead.
>
> Link: https://lkml.kernel.org/r/20230225121523.3288544-1-geert+renesas@glider.be
> Fixes: b7d89654a988a2a4 ("zram: show zsmalloc objs_moved stat in mm_stat")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reported-by; <noreply@ellerman.id.au>

Oops, I accidentally typed a semicolon instead of a colon.
That's actually better, as the noreply address is a real noreply
address, and bounces ;-)

> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Minchan Kim <minchan@kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-26  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-26  4:31 + zram-show-zsmalloc-objs_moved-stat-in-mm_stat-fix.patch added to mm-unstable branch Andrew Morton
2023-02-26  9:48 ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.