From: Dan Carpenter <dan.carpenter@linaro.org>
To: Jan Kara <jack@suse.cz>
Cc: oe-kbuild@lists.linux.dev,
Roman Gushchin <roman.gushchin@linux.dev>,
lkp@intel.com, oe-kbuild-all@lists.linux.dev,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Dev Jain <dev.jain@arm.com>
Subject: Re: mm/filemap.c:3307 do_sync_mmap_readahead() warn: assigning (-12) to unsigned variable 'ra->order'
Date: Tue, 13 Jan 2026 15:56:30 +0300 [thread overview]
Message-ID: <aWZA_rfBLWa9eCnr@stanley.mountain> (raw)
In-Reply-To: <s47y6ysj4c2z5c5axtxbeset4divigctg4s3p7gbgmvfkoizeu@malcpodvrm46>
On Tue, Jan 13, 2026 at 01:24:20PM +0100, Jan Kara wrote:
> On Tue 13-01-26 14:12:28, Dan Carpenter wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: b71e635feefc852405b14620a7fc58c4c80c0f73
> > commit: 9f1edf1aedac1b287355f63f768ba4275de72dca mm: readahead: make thp readahead conditional to mmap_miss logic
> > config: x86_64-randconfig-161-20260113 (https://download.01.org/0day-ci/archive/20260113/202601131311.g3lyUAks-lkp@intel.com/config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> > smatch version: v0.5.0-8985-g2614ff1a
> >
> > 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>
> > | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> > | Closes: https://lore.kernel.org/r/202601131311.g3lyUAks-lkp@intel.com/
> >
> > smatch warnings:
> > mm/filemap.c:3307 do_sync_mmap_readahead() warn: assigning (-12) to unsigned variable 'ra->order'
> ...
> > 9f1edf1aedac1b2 Roman Gushchin 2025-10-06 3306 ra->async_size = HPAGE_PMD_NR;
> > 9f1edf1aedac1b2 Roman Gushchin 2025-10-06 @3307 ra->order = HPAGE_PMD_ORDER;
> >
> > HPAGE_PMD_SHIFT is zero in this config?
> > ra->order is a u16.
>
> What's the config exactly? I suppose CONFIG_TRANSPARENT_HUGEPAGE is
> disabled in this case, isn't it? In that case force_thp_readahead will
> never be true and thus the branch with the assignment can never be reached
> AFAICT...
>
Ah, yes. You are right. force_thp_readahead is false in this
config.
The truth is, I could easily disable these kinds of warnings in smatch
because this is marked as an impossible path. if (is_impossible_path())
return... I've done that on a case by case basis in the past but maybe I
should just do it globally.
regards,
dan carpenter
prev parent reply other threads:[~2026-01-13 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 11:12 Dan Carpenter
2026-01-13 12:24 ` Jan Kara
2026-01-13 12:56 ` Dan Carpenter [this message]
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=aWZA_rfBLWa9eCnr@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=dev.jain@arm.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=roman.gushchin@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