From: Nathan Chancellor <nathan@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: "David Hildenbrand (Red Hat)" <david@kernel.org>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [akpm-mm:mm-unstable 36/283] mm/hugetlb.c:4753:18: warning: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 17179869184 to 0
Date: Fri, 14 Nov 2025 11:29:56 -0700 [thread overview]
Message-ID: <20251114182956.GD2566209@ax162> (raw)
In-Reply-To: <202511141140.LrrRrtIv-lkp@intel.com>
On Fri, Nov 14, 2025 at 02:46:06PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> head: 1c571d1c4c7e042c3c313d1a2058a17848ccebac
> commit: 2f6ff71280ffddb27ad7174d24f573e2683870cd [36/283] mm: fix MAX_FOLIO_ORDER on powerpc configs with hugetlb
> config: powerpc-randconfig-002-20251114 (https://download.01.org/0day-ci/archive/20251114/202511141140.LrrRrtIv-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 0bba1e76581bad04e7d7f09f5115ae5e2989e0d9)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251114/202511141140.LrrRrtIv-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/oe-kbuild-all/202511141140.LrrRrtIv-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
...
> >> mm/util.c:1263:16: warning: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 17179869184 to 0 [-Wconstant-conversion]
> 1263 | if (ps->idx < MAX_FOLIO_NR_PAGES) {
> | ^~~~~~~~~~~~~~~~~~
> include/linux/mm.h:2104:36: note: expanded from macro 'MAX_FOLIO_NR_PAGES'
> 2104 | #define MAX_FOLIO_NR_PAGES (1UL << MAX_FOLIO_ORDER)
> | ^~~~~~~~~~~~~~~
> include/linux/mm.h:2095:36: note: expanded from macro 'MAX_FOLIO_ORDER'
> 2095 | #define MAX_FOLIO_ORDER get_order(SZ_16G)
> | ~~~~~~~~~ ^~~~~~
> include/linux/sizes.h:56:19: note: expanded from macro 'SZ_16G'
> 56 | #define SZ_16G _AC(0x400000000, ULL)
> | ^~~~~~~~~~~~~~~~~~~~~
> include/uapi/linux/const.h:21:18: note: expanded from macro '_AC'
> 21 | #define _AC(X,Y) __AC(X,Y)
> | ^~~~~~~~~
> include/uapi/linux/const.h:20:20: note: expanded from macro '__AC'
> 20 | #define __AC(X,Y) (X##Y)
> | ^~~~
> <scratch space>:39:1: note: expanded from here
> 39 | 0x400000000ULL
> | ^~~~~~~~~~~~~~
> 1 warning generated.
For the record, this is not a clang specific warning, as it happens when
building the same configuration with GCC:
In file included from include/vdso/const.h:5,
from include/vdso/bits.h:5,
from include/linux/bits.h:5,
from include/linux/ratelimit_types.h:5,
from include/linux/printk.h:9,
from include/asm-generic/bug.h:28,
from arch/powerpc/include/asm/bug.h:116,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:6,
from mm/util.c:2:
mm/util.c: In function 'snapshot_page':
include/uapi/linux/const.h:20:25: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '17179869184' to '0' [-Woverflow]
20 | #define __AC(X,Y) (X##Y)
| ^~~~~~
include/uapi/linux/const.h:21:25: note: in expansion of macro '__AC'
21 | #define _AC(X,Y) __AC(X,Y)
| ^~~~
include/linux/sizes.h:56:41: note: in expansion of macro '_AC'
56 | #define SZ_16G _AC(0x400000000, ULL)
| ^~~
include/linux/mm.h:2214:43: note: in expansion of macro 'SZ_16G'
2214 | #define MAX_FOLIO_ORDER get_order(SZ_16G)
| ^~~~~~
include/linux/mm.h:2223:41: note: in expansion of macro 'MAX_FOLIO_ORDER'
2223 | #define MAX_FOLIO_NR_PAGES (1UL << MAX_FOLIO_ORDER)
| ^~~~~~~~~~~~~~~
mm/util.c:1266:23: note: in expansion of macro 'MAX_FOLIO_NR_PAGES'
1266 | if (ps->idx < MAX_FOLIO_NR_PAGES) {
| ^~~~~~~~~~~~~~~~~~
Cheers,
Nathan
next prev parent reply other threads:[~2025-11-14 18:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 6:46 [akpm-mm:mm-unstable 36/283] mm/hugetlb.c:4753:18: warning: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 17179869184 to 0 kernel test robot
2025-11-14 18:29 ` Nathan Chancellor [this message]
2025-11-14 18:54 ` Matthew Wilcox
2025-11-14 19:18 ` Nathan Chancellor
2025-11-14 19:39 ` David Hildenbrand (Red Hat)
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=20251114182956.GD2566209@ax162 \
--to=nathan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).