From patchwork Wed Feb 2 14:04:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12732990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED873C433F5 for ; Wed, 2 Feb 2022 14:05:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81D5A8D0102; Wed, 2 Feb 2022 09:05:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CBCF8D00FA; Wed, 2 Feb 2022 09:05:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66CF18D0102; Wed, 2 Feb 2022 09:05:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id 58ADA8D00FA for ; Wed, 2 Feb 2022 09:05:06 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1424482E8197 for ; Wed, 2 Feb 2022 14:05:06 +0000 (UTC) X-FDA: 79098011412.12.CF277C0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 8B65E40002 for ; Wed, 2 Feb 2022 14:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643810705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LKXvUjky6U95W40duLCBj5rNPNib3n3NzIkg22PjaKw=; b=g60Nje3cfdhHl/XrKQNrqn8NZwYnZ1Bpo7qloh3k6pU5yC0P1z8u5RvXx/praZmYXseIzz 7XPl5vCo+qlG46wMxrtpsty8k1JsVcnQx6yG9F+aS7M+3AJz5rux7zHBuEJSCXAMYo1/rr dsnAJAk0YnWG1EFn5gozEknlQGiu8N8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-299-JW0en-7fNce9miWLvQ1T3w-1; Wed, 02 Feb 2022 09:05:03 -0500 X-MC-Unique: JW0en-7fNce9miWLvQ1T3w-1 Received: by mail-wm1-f70.google.com with SMTP id l20-20020a05600c1d1400b0035153bf34c3so3959077wms.2 for ; Wed, 02 Feb 2022 06:05:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LKXvUjky6U95W40duLCBj5rNPNib3n3NzIkg22PjaKw=; b=IHhi4g0uBfyrulB2X/eCERi8oUSh98+6izcysdy6FxzWz7GCEAiPrJEFP0IgniEEUJ nL9awy06GX5YtsdU/6cVitPAm6xmp3GacoVNasvcpKl9VNkXkjyJVnZsNdviws8nVscM LmjuO0ZLTPWFnx/D7R0KcTMbDS8W95W6DWeaKz+Uk8Jicj2aFDkUFWs+Fq+AY/V5Nl4E BIIYi9ez10BVtyEvqqrMx7Cz6AxwIBYfAXECpqkZq3bNHzBhcQSV9QCdvorXd4Jt0qRT E6PENd0atTGIHOfsw2hXP98xgOt7U9YojwQI98jKbCuhSyRWJZDHu7is8tkpCY3BRJjr 3pRg== X-Gm-Message-State: AOAM531NVwEYOVdfe51e5IjyN8rpYUZis18IxQR/YJEa9boyu2Y7Vpmo TVM//RxrpZaN2XUThKZGhm2qlMC20ITKo/Uog+inYMJ7EyUn1rvHt/i05Y6jPeCoY7P5tnOHMIi y1BtpGdHSEjg= X-Received: by 2002:a5d:6c61:: with SMTP id r1mr26149497wrz.414.1643810702583; Wed, 02 Feb 2022 06:05:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhUIST0Awqaun/ofpc39z5ZRnSV4PkM4qvGlYJX0Eb+SUFwsOtn9g5VHUyneOaLQomWHOKlg== X-Received: by 2002:a5d:6c61:: with SMTP id r1mr26149481wrz.414.1643810702359; Wed, 02 Feb 2022 06:05:02 -0800 (PST) Received: from vian.redhat.com ([2a0c:5a80:1e09:d600:637e:7f1b:a4a0:fc92]) by smtp.gmail.com with ESMTPSA id e10sm20639384wrq.53.2022.02.02.06.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 06:05:02 -0800 (PST) From: Nicolas Saenz Julienne To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Nicolas Saenz Julienne , Vlastimil Babka Subject: [PATCH] mm/page_alloc: Don't pass pfn to free_unref_page_commit() Date: Wed, 2 Feb 2022 15:04:51 +0100 Message-Id: <20220202140451.415928-1-nsaenzju@redhat.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8B65E40002 X-Stat-Signature: nz7hhqggd6tbgm5ejeopqqr1g1cs5br8 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=g60Nje3c; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf04.hostedemail.com: domain of nsaenzju@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=nsaenzju@redhat.com X-Rspam-User: nil X-HE-Tag: 1643810705-312872 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: free_unref_page_commit() doesn't make use of its pfn argument, so get rid of it. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Vlastimil Babka Reviewed-by: Matthew Wilcox (Oracle) --- NOTE: This first appeared here, where Vlastimil gave his Reviewed-by: https://lore.kernel.org/lkml/51e45c99-1ad8-339b-0c6a-e88288fa41ba@suse.cz/ The rest of the series was discarded, but this patch has value on its own. mm/page_alloc.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7c417bec8207..4f549123150c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3422,8 +3422,8 @@ static int nr_pcp_high(struct per_cpu_pages *pcp, struct zone *zone) return min(READ_ONCE(pcp->batch) << 2, high); } -static void free_unref_page_commit(struct page *page, unsigned long pfn, - int migratetype, unsigned int order) +static void free_unref_page_commit(struct page *page, int migratetype, + unsigned int order) { struct zone *zone = page_zone(page); struct per_cpu_pages *pcp; @@ -3472,7 +3472,7 @@ void free_unref_page(struct page *page, unsigned int order) } local_lock_irqsave(&pagesets.lock, flags); - free_unref_page_commit(page, pfn, migratetype, order); + free_unref_page_commit(page, migratetype, order); local_unlock_irqrestore(&pagesets.lock, flags); } @@ -3482,13 +3482,13 @@ void free_unref_page(struct page *page, unsigned int order) void free_unref_page_list(struct list_head *list) { struct page *page, *next; - unsigned long flags, pfn; + unsigned long flags; int batch_count = 0; int migratetype; /* Prepare pages for freeing */ list_for_each_entry_safe(page, next, list, lru) { - pfn = page_to_pfn(page); + unsigned long pfn = page_to_pfn(page); if (!free_unref_page_prepare(page, pfn, 0)) { list_del(&page->lru); continue; @@ -3504,15 +3504,10 @@ void free_unref_page_list(struct list_head *list) free_one_page(page_zone(page), page, pfn, 0, migratetype, FPI_NONE); continue; } - - set_page_private(page, pfn); } local_lock_irqsave(&pagesets.lock, flags); list_for_each_entry_safe(page, next, list, lru) { - pfn = page_private(page); - set_page_private(page, 0); - /* * Non-isolated types over MIGRATE_PCPTYPES get added * to the MIGRATE_MOVABLE pcp list. @@ -3522,7 +3517,7 @@ void free_unref_page_list(struct list_head *list) migratetype = MIGRATE_MOVABLE; trace_mm_page_free_batched(page); - free_unref_page_commit(page, pfn, migratetype, 0); + free_unref_page_commit(page, migratetype, 0); /* * Guard against excessive IRQ disabled times when we get