All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/debug: add a cast to u64 for atomic64_read()
@ 2019-03-10 18:30 Qian Cai
  2019-03-11  3:58 ` Davidlohr Bueso
  0 siblings, 1 reply; 18+ messages in thread
From: Qian Cai @ 2019-03-10 18:30 UTC (permalink / raw)
  To: akpm; +Cc: dave, jgg, arnd, linux-mm, linux-kernel, Qian Cai

atomic64_read() on ppc64le returns "long int", so fix the same way as
the commit d549f545e690 ("drm/virtio: use %llu format string form
atomic64_t") by adding a cast to u64, which makes it work on all arches.

In file included from ./include/linux/printk.h:7,
                 from ./include/linux/kernel.h:15,
                 from mm/debug.c:9:
mm/debug.c: In function 'dump_mm':
./include/linux/kern_levels.h:5:18: warning: format '%llx' expects
argument of type 'long long unsigned int', but argument 19 has type
'long int' [-Wformat=]
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^~~~~~
./include/linux/kern_levels.h:8:20: note: in expansion of macro
'KERN_SOH'
 #define KERN_EMERG KERN_SOH "0" /* system is unusable */
                    ^~~~~~~~
./include/linux/printk.h:297:9: note: in expansion of macro 'KERN_EMERG'
  printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
         ^~~~~~~~~~
mm/debug.c:133:2: note: in expansion of macro 'pr_emerg'
  pr_emerg("mm %px mmap %px seqnum %llu task_size %lu\n"
  ^~~~~~~~
mm/debug.c:140:17: note: format string is defined here
   "pinned_vm %llx data_vm %lx exec_vm %lx stack_vm %lx\n"
              ~~~^
              %lx

Fixes: 70f8a3ca68d3 ("mm: make mm->pinned_vm an atomic64 counter")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 mm/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/debug.c b/mm/debug.c
index c0b31b6c3877..45d9eb77b84e 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -168,7 +168,7 @@ void dump_mm(const struct mm_struct *mm)
 		mm_pgtables_bytes(mm),
 		mm->map_count,
 		mm->hiwater_rss, mm->hiwater_vm, mm->total_vm, mm->locked_vm,
-		atomic64_read(&mm->pinned_vm),
+		(u64)atomic64_read(&mm->pinned_vm),
 		mm->data_vm, mm->exec_vm, mm->stack_vm,
 		mm->start_code, mm->end_code, mm->start_data, mm->end_data,
 		mm->start_brk, mm->brk, mm->start_stack,
-- 
2.17.2 (Apple Git-113)


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

end of thread, other threads:[~2019-03-13 16:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-10 18:30 [PATCH] mm/debug: add a cast to u64 for atomic64_read() Qian Cai
2019-03-11  3:58 ` Davidlohr Bueso
2019-03-11 12:21   ` Jason Gunthorpe
2019-03-11 14:00     ` Qian Cai
2019-03-11 14:00       ` Qian Cai
2019-03-11 14:20       ` Arnd Bergmann
2019-03-11 14:20         ` Arnd Bergmann
2019-03-13  9:18         ` Peter Zijlstra
2019-03-13 13:46           ` Arnd Bergmann
2019-03-13 13:46             ` Arnd Bergmann
2019-03-13 14:21             ` Peter Zijlstra
2019-03-13 14:24             ` Peter Zijlstra
2019-03-13 14:35           ` Mark Rutland
2019-03-13 14:57             ` Arnd Bergmann
2019-03-13 14:57               ` Arnd Bergmann
2019-03-13 16:29               ` Mark Rutland
2019-03-11 14:00     ` Arnd Bergmann
2019-03-11 14:00       ` Arnd Bergmann

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.