From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by kanga.kvack.org (Postfix) with ESMTP id C0CA36B0005 for ; Thu, 12 May 2016 02:16:39 -0400 (EDT) Received: by mail-lb0-f199.google.com with SMTP id ne4so6576404lbc.1 for ; Wed, 11 May 2016 23:16:39 -0700 (PDT) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com. [74.125.82.66]) by mx.google.com with ESMTPS id jf6si6820413wjb.6.2016.05.11.23.16.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 May 2016 23:16:38 -0700 (PDT) Received: by mail-wm0-f66.google.com with SMTP id e201so13687368wme.2 for ; Wed, 11 May 2016 23:16:38 -0700 (PDT) Date: Thu, 12 May 2016 08:16:36 +0200 From: Michal Hocko Subject: Re: [PATCH] mm, compaction: avoid uninitialized variable use Message-ID: <20160512061636.GA4200@dhcp22.suse.cz> References: <1462973126-1183468-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462973126-1183468-1-git-send-email-arnd@arndb.de> Sender: owner-linux-mm@kvack.org List-ID: To: Arnd Bergmann Cc: Andrew Morton , Mel Gorman , Vlastimil Babka , David Rientjes , Joonsoo Kim , Taku Izumi , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org 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 mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752139AbcELGQk (ORCPT ); Thu, 12 May 2016 02:16:40 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36555 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbcELGQj (ORCPT ); Thu, 12 May 2016 02:16:39 -0400 Date: Thu, 12 May 2016 08:16:36 +0200 From: Michal Hocko To: Arnd Bergmann Cc: Andrew Morton , Mel Gorman , Vlastimil Babka , David Rientjes , Joonsoo Kim , Taku Izumi , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm, compaction: avoid uninitialized variable use Message-ID: <20160512061636.GA4200@dhcp22.suse.cz> References: <1462973126-1183468-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462973126-1183468-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 Signed-off-by: Michal Hocko --- 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; } -- 2.8.1 -- Michal Hocko SUSE Labs