From patchwork Wed Sep 2 18:43:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 264404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB0EEC433E2 for ; Wed, 2 Sep 2020 18:43:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5D582083B for ; Wed, 2 Sep 2020 18:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgIBSna (ORCPT ); Wed, 2 Sep 2020 14:43:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:55080 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgIBSna (ORCPT ); Wed, 2 Sep 2020 14:43:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 26FE8B5B7; Wed, 2 Sep 2020 18:43:30 +0000 (UTC) From: Daniel Wagner To: stable@vger.kernel.org Cc: Mel Gorman , Vlastimil Babka , Jesper Dangaard Brouer , Andrew Morton , Linus Torvalds , Daniel Wagner Subject: [PATCH 4.4] mm, page_alloc: remove unnecessary variable from free_pcppages_bulk Date: Wed, 2 Sep 2020 20:43:27 +0200 Message-Id: <20200902184327.12530-1-dwagner@suse.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mel Gorman [ Upstream commit e5b31ac2ca2cd0cf6bf2fcbb708ed01466c89aaa ] The original count is never reused so it can be removed. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Cc: Jesper Dangaard Brouer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [dwagner: update context] Signed-off-by: Daniel Wagner --- Hi, The backport commit 0c9ce43da97d ("mm, page_alloc: fix core hung in free_pcppages_bulk()") has the depency to this commit. It went in v4.6 so only v4.4 is effected. Thanks, Daniel mm/page_alloc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 14bab5fa1b65..3570aaf2a620 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -835,7 +835,6 @@ static void free_pcppages_bulk(struct zone *zone, int count, { int migratetype = 0; int batch_free = 0; - int to_free = count; unsigned long nr_scanned; spin_lock(&zone->lock); @@ -848,7 +847,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, * below while (list_empty(list)) loop. */ count = min(pcp->count, count); - while (to_free) { + while (count) { struct page *page; struct list_head *list; @@ -868,7 +867,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, /* This is the only non-empty list. Free them all. */ if (batch_free == MIGRATE_PCPTYPES) - batch_free = to_free; + batch_free = count; do { int mt; /* migratetype of the to-be-freed page */ @@ -886,7 +885,7 @@ static void free_pcppages_bulk(struct zone *zone, int count, __free_one_page(page, page_to_pfn(page), zone, 0, mt); trace_mm_page_pcpu_drain(page, 0, mt); - } while (--to_free && --batch_free && !list_empty(list)); + } while (--count && --batch_free && !list_empty(list)); } spin_unlock(&zone->lock); }