From: Dan Carpenter <error27@gmail.com>
To: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: smatch@vger.kernel.org
Subject: Re: hugetlb BUILD REGRESSION in linux-next20221121
Date: Tue, 29 Nov 2022 07:57:15 +0300 [thread overview]
Message-ID: <Y4WRK97aXPjqlWnV@kadam> (raw)
In-Reply-To: <c009bf64-9d7c-b831-9087-936a3e0801d4@oracle.com>
On Mon, Nov 28, 2022 at 02:34:54PM -0800, Sidhartha Kumar wrote:
> Hello,
>
> One of my patches in linux-next was flagged as a Unverified Error/Warning
> with the following warning[1]:
>
> mm/hugetlb.c:2073 alloc_pool_huge_page() error: uninitialized symbol
> 'folio'.
>
> The relevant change is:
>
> - struct page *page;
> + struct folio *folio;
> int nr_nodes, node;
> gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE;
>
> for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) {
> - page = alloc_fresh_huge_page(h, gfp_mask, node, nodes_allowed,
> - node_alloc_noretry);
> - if (page)
> + folio = alloc_fresh_hugetlb_folio(h, gfp_mask, node,
> + nodes_allowed, node_alloc_noretry);
> + if (folio)
> break;
> }
>
> - if (!page)
> + if (!folio)
>
> It looks like I can initialize folio to NULL to avoid this error but I'm not
> sure how this would cause a regression as previously the page variable was
> unitialized as well. Please let me know if I am missing something in my
> patch or if this should be ignored.
Both the original and the new code trigger a Smatch warning. I don't
know why the kbuild-bot marks this as a new warning. Possibly that's
because the variable name has changed? The kbuild-bot is run by Intel.
The problem is obviously that Smatch doesn't know that we always enter
the loop. There are hack arounds that I could do for this, but
sometimes we dont' actually enter the loop so changing this will hide
bugs... I am conflicted on this.
regards,
dan carpenter
next prev parent reply other threads:[~2022-11-29 4:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 22:34 hugetlb BUILD REGRESSION in linux-next20221121 Sidhartha Kumar
2022-11-29 4:57 ` Dan Carpenter [this message]
2022-11-29 7:40 ` Rasmus Villemoes
2022-11-29 17:23 ` Sidhartha Kumar
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=Y4WRK97aXPjqlWnV@kadam \
--to=error27@gmail.com \
--cc=sidhartha.kumar@oracle.com \
--cc=smatch@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.