[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWZA_rfBLWa9eCnr@stanley.mountain>
Date: Tue, 13 Jan 2026 15:56:30 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Jan Kara <jack@...e.cz>
Cc: oe-kbuild@...ts.linux.dev, Roman Gushchin <roman.gushchin@...ux.dev>,
lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Memory Management List <linux-mm@...ck.org>,
Dev Jain <dev.jain@....com>
Subject: Re: mm/filemap.c:3307 do_sync_mmap_readahead() warn: assigning (-12)
to unsigned variable 'ra->order'
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@...el.com>
> > | Reported-by: Dan Carpenter <dan.carpenter@...aro.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
Powered by blists - more mailing lists