From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@kernel.org>, Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Mel Gorman <mgorman@techsingularity.net>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Taku Izumi <izumi.taku@jp.fujitsu.com>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm, compaction: avoid uninitialized variable use
Date: Thu, 12 May 2016 14:00:18 +0200 [thread overview]
Message-ID: <57347052.7030307@suse.cz> (raw)
In-Reply-To: <20160512061636.GA4200@dhcp22.suse.cz>
On 05/12/2016 08:16 AM, Michal Hocko wrote:
> I think this would be slightly better than your proposal. Andrew, could
> you fold it into the original
> mm-compaction-simplify-__alloc_pages_direct_compact-feedback-interface.patch
> patch?
> ---
> From 434bc8b6f3787724327499998c4fe651e8ce5d68 Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@suse.com>
> Date: Thu, 12 May 2016 08:10:33 +0200
> Subject: [PATCH] mmotm:
> mm-compaction-simplify-__alloc_pages_direct_compact-feedback-interface-fix
>
> Arnd has reported the following compilation warning:
> mm/page_alloc.c: In function '__alloc_pages_nodemask':
> mm/page_alloc.c:3651:6: error: 'compact_result' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> This should be a false positive TRANSPARENT_HUGEPAGE depends on COMPACTION
> so is_thp_gfp_mask shouldn't be true. GFP_TRANSHUGE is a bit tricky
> and somebody might be using this accidently. Make sure that compact_result
> is defined also for !CONFIG_COMPACT and set it to COMPACT_SKIPPED because
> the compaction was really withdrawn.
>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Michal Hocko <mhocko@suse.com>
Ack.
> ---
> mm/page_alloc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 4950d01ff935..0d9008042efa 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3300,6 +3300,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
> unsigned int alloc_flags, const struct alloc_context *ac,
> enum migrate_mode mode, enum compact_result *compact_result)
> {
> + *compact_result = COMPACT_SKIPPED;
> return NULL;
> }
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-05-12 12:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 13:24 [PATCH] mm, compaction: avoid uninitialized variable use Arnd Bergmann
2016-05-11 14:44 ` Michal Hocko
2016-05-11 14:52 ` Arnd Bergmann
2016-05-11 16:13 ` Michal Hocko
2016-05-11 14:53 ` Michal Hocko
2016-05-12 6:16 ` Michal Hocko
2016-05-12 12:00 ` Vlastimil Babka [this message]
2016-05-12 12:04 ` Arnd Bergmann
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=57347052.7030307@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).