From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756939AbcDLKNo (ORCPT ); Tue, 12 Apr 2016 06:13:44 -0400 Received: from outbound-smtp07.blacknight.com ([46.22.139.12]:42329 "EHLO outbound-smtp07.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756857AbcDLKNl (ORCPT ); Tue, 12 Apr 2016 06:13:41 -0400 From: Mel Gorman To: Andrew Morton Cc: Vlastimil Babka , Linux-MM , LKML , Mel Gorman Subject: [PATCH 13/24] mm, page_alloc: Remove redundant check for empty zonelist Date: Tue, 12 Apr 2016 11:12:14 +0100 Message-Id: <1460455945-29644-14-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1460455945-29644-1-git-send-email-mgorman@techsingularity.net> References: <1460455945-29644-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A check is made for an empty zonelist early in the page allocator fast path but it's unnecessary. The check after first_zones_zonelist call should catch that situation. Removing the first check is slower for machines with memoryless nodes but that is a corner case that can live with the overhead. Signed-off-by: Mel Gorman --- mm/page_alloc.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index df03ccc7f07c..e50e754ec9eb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3374,14 +3374,6 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, if (should_fail_alloc_page(gfp_mask, order)) return NULL; - /* - * Check the zones suitable for the gfp_mask contain at least one - * valid zone. It's possible to have an empty zonelist as a result - * of __GFP_THISNODE and a memoryless node - */ - if (unlikely(!zonelist->_zonerefs->zone)) - return NULL; - if (IS_ENABLED(CONFIG_CMA) && ac.migratetype == MIGRATE_MOVABLE) alloc_flags |= ALLOC_CMA; -- 2.6.4