public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: Re: [willy-pagecache:for-next 52/85] mm/page_vma_mapped.c:246 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 << ( - 12))) => (0-u32max >= 0)'
Date: Mon, 14 Feb 2022 15:20:30 +0000	[thread overview]
Message-ID: <YgpzPru8aFA5sHOI@casper.infradead.org> (raw)
In-Reply-To: <202202141933.YLNzdo4f-lkp@intel.com>

Hey Dan, is this an smatch bug?

On Mon, Feb 14, 2022 at 07:53:39PM +0800, kernel test robot wrote:
> tree:   git://git.infradead.org/users/willy/pagecache for-next
> head:   c267b33d0001488f1d9dad12d6a87655e174d914
> commit: 9733dd1f11d6b6f8a38fa82f0cc014f7840cbd67 [52/85] mm: Convert page_vma_mapped_walk to work on PFNs
> config: xtensa-randconfig-m031-20220213 (https://download.01.org/0day-ci/archive/20220214/202202141933.YLNzdo4f-lkp@intel.com/config)
> compiler: xtensa-linux-gcc (GCC) 11.2.0
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> smatch warnings:
> mm/page_vma_mapped.c:246 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 << ( - 12))) => (0-u32max >= 0)'

[...]

>    244				if ((pvmw->flags & PVMW_SYNC) &&
>    245				    transparent_hugepage_active(vma) &&
>  > 246				    (pvmw->nr_pages >= HPAGE_PMD_NR)) {
>    247					spinlock_t *ptl = pmd_lock(mm, pvmw->pmd);

The config in question doesn't enable CONFIG_TRANSPARENT_HUGEPAGE,
so this condition should turn into
	if ((pvmw->flags & PVMW_SYNC) && false && true)
and I don't think smatch should warn on the third clause of the if
being always-true when the second one is false.  Of course, it's not a
literal "false", it's:

static inline bool transparent_hugepage_active(struct vm_area_struct *vma)
{
        return false;
}

unless my debugging / understanding of this issue has gone astray.

      reply	other threads:[~2022-02-14 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 11:53 [willy-pagecache:for-next 52/85] mm/page_vma_mapped.c:246 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 << ( - 12))) => (0-u32max >= 0)' kernel test robot
2022-02-14 15:20 ` Matthew Wilcox [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=YgpzPru8aFA5sHOI@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.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