public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Usama Arif <usamaarif642@gmail.com>
To: kernel test robot <lkp@intel.com>,
	akpm@linux-foundation.org, linux-mm@kvack.org
Cc: oe-kbuild-all@lists.linux.dev, hannes@cmpxchg.org,
	shakeel.butt@linux.dev, roman.gushchin@linux.dev,
	yuzhao@google.com, david@redhat.com, baohua@kernel.org,
	ryan.roberts@arm.com, rppt@kernel.org, willy@infradead.org,
	cerasuolodomenico@gmail.com, corbet@lwn.net,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	kernel-team@meta.com, Alexander Zhu <alexlzhu@fb.com>,
	riel@surriel.com
Subject: Re: [PATCH 5/6] mm: add selftests to split_huge_page() to verify unmap/zap of zero pages
Date: Tue, 6 Aug 2024 23:02:38 +0100	[thread overview]
Message-ID: <4ed9feaa-b7dc-4a02-a58d-ee845e872bd2@gmail.com> (raw)
In-Reply-To: <ZqsS/1ts8leyUeEQ@rli9-mobl>



On 01/08/2024 05:45, kernel test robot wrote:
> Hi Usama,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on akpm-mm/mm-everything]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Usama-Arif/Revert-memcg-remove-mem_cgroup_uncharge_list/20240730-223949
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> patch link:    https://lore.kernel.org/r/20240730125346.1580150-6-usamaarif642%40gmail.com
> patch subject: [PATCH 5/6] mm: add selftests to split_huge_page() to verify unmap/zap of zero pages
> :::::: branch date: 32 hours ago
> :::::: commit date: 32 hours ago
> compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240801/202408010618.lgnamdZd-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/r/202408010618.lgnamdZd-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    vm_util.c: In function 'rss_anon':
>>> vm_util.c:188:41: warning: format '%ld' expects argument of type 'long int *', but argument 3 has type 'uint64_t *' {aka 'long long unsigned int *'} [-Wformat=]
>      188 |         if (sscanf(buffer, "RssAnon:%10ld kB", &rss_anon) != 1)
>          |                                     ~~~~^      ~~~~~~~~~
>          |                                         |      |
>          |                                         |      uint64_t * {aka long long unsigned int *}
>          |                                         long int *
>          |                                     %10lld
> 
> 

Interesting affect of different compilers!

If I compile with the above suggestion on my machine, i.e. convert ld to lld, I get a warning on my machine that uint64_t is long unsigned int (and not long long unsigned int as above):

vm_util.c: In function ‘rss_anon’:
vm_util.c:188:42: warning: format ‘%lld’ expects argument of type ‘long long int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long unsigned int *’} [-Wformat=]
  188 |         if (sscanf(buffer, "RssAnon:%10lld kB", &rss_anon) != 1)
      |                                     ~~~~~^      ~~~~~~~~~
      |                                          |      |
      |                                          |      uint64_t * {aka long unsigned int *}
      |                                          long long int *
      |                                     %10ld


I will just do below which should work hopefully with all compilers: 
diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c
index 7b7e763ba8e3..bd147bdb1bb2 100644
--- a/tools/testing/selftests/mm/vm_util.c
+++ b/tools/testing/selftests/mm/vm_util.c
@@ -172,9 +172,9 @@ uint64_t read_pmd_pagesize(void)
        return strtoul(buf, NULL, 10);
 }
 
-uint64_t rss_anon(void)
+long unsigned rss_anon(void)
 {
-       uint64_t rss_anon = 0;
+       long unsigned rss_anon = 0;
        FILE *fp;
        char buffer[MAX_LINE_LENGTH];
 
@@ -185,7 +185,7 @@ uint64_t rss_anon(void)
        if (!check_for_pattern(fp, "RssAnon:", buffer, sizeof(buffer)))
                goto err_out;
 
-       if (sscanf(buffer, "RssAnon:%10ld kB", &rss_anon) != 1)
+       if (sscanf(buffer, "RssAnon:%10lu kB", &rss_anon) != 1)
                ksft_exit_fail_msg("Reading status error\n");
 
 err_out:

  reply	other threads:[~2024-08-06 22:02 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 12:45 [PATCH 0/6] mm: split underutilized THPs Usama Arif
2024-07-30 12:45 ` [PATCH 1/6] Revert "memcg: remove mem_cgroup_uncharge_list()" Usama Arif
2024-07-30 12:45 ` [PATCH 2/6] Revert "mm: remove free_unref_page_list()" Usama Arif
2024-07-30 12:46 ` [PATCH 3/6] mm: free zapped tail pages when splitting isolated thp Usama Arif
2024-07-30 15:14   ` David Hildenbrand
2024-08-04 19:02     ` Usama Arif
2024-08-05  9:00       ` David Hildenbrand
2024-08-06  9:58         ` Usama Arif
2024-07-30 12:46 ` [PATCH 4/6] mm: don't remap unused subpages " Usama Arif
2024-07-30 18:07   ` Rik van Riel
2024-07-31 17:08     ` Usama Arif
2024-07-30 12:46 ` [PATCH 5/6] mm: add selftests to split_huge_page() to verify unmap/zap of zero pages Usama Arif
2024-07-30 18:10   ` Rik van Riel
2024-08-01  4:45   ` kernel test robot
2024-08-06 22:02     ` Usama Arif [this message]
2024-07-30 12:46 ` [PATCH 6/6] mm: split underutilized THPs Usama Arif
2024-07-30 13:59   ` Randy Dunlap
2024-07-30 14:35 ` [PATCH 0/6] " David Hildenbrand
2024-07-30 15:14   ` Usama Arif
2024-07-30 15:19     ` Usama Arif
2024-07-30 16:11       ` David Hildenbrand
2024-07-30 17:22         ` Usama Arif
2024-07-30 20:25           ` David Hildenbrand
2024-07-31 17:01             ` Usama Arif
2024-07-31 17:51               ` David Hildenbrand
2024-07-31 20:41                 ` Usama Arif
2024-08-01  6:36                   ` David Hildenbrand
2024-08-04 23:04                     ` Usama Arif
2024-08-06 17:17                       ` Usama Arif
2024-08-06 17:30                         ` David Hildenbrand
2024-08-06 17:28                     ` Johannes Weiner
2024-08-06 17:33                       ` David Hildenbrand
2024-08-01  6:09 ` Yu Zhao
2024-08-01 15:47   ` David Hildenbrand
2024-08-04 21:54     ` Yu Zhao
2024-08-05  1:32       ` Rik van Riel
2024-08-05 19:51         ` Yu Zhao
2024-08-01 16:22   ` Usama Arif
2024-08-01 16:27     ` David Hildenbrand
2024-08-04 19:10       ` Usama Arif
2024-08-04 23:32       ` Yu Zhao
2024-08-04 23:23     ` Yu Zhao
2024-08-06 11:18       ` Usama Arif
2024-08-06 17:38   ` Johannes Weiner
2024-08-06 18:06     ` Yu Zhao
2024-08-06 19:54       ` Johannes Weiner
2024-08-06 20:53         ` Yu Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ed9feaa-b7dc-4a02-a58d-ee845e872bd2@gmail.com \
    --to=usamaarif642@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexlzhu@fb.com \
    --cc=baohua@kernel.org \
    --cc=cerasuolodomenico@gmail.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@meta.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=riel@surriel.com \
    --cc=roman.gushchin@linux.dev \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=shakeel.butt@linux.dev \
    --cc=willy@infradead.org \
    --cc=yuzhao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox