From patchwork Wed Nov 3 17:05:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 12601221 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F298BC4332F for ; Wed, 3 Nov 2021 17:05:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9089B61108 for ; Wed, 3 Nov 2021 17:05:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9089B61108 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id ACCC46B006C; Wed, 3 Nov 2021 13:05:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A55ED940007; Wed, 3 Nov 2021 13:05:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CEE36B0073; Wed, 3 Nov 2021 13:05:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 77CC36B006C for ; Wed, 3 Nov 2021 13:05:25 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F2EA370003 for ; Wed, 3 Nov 2021 17:05:24 +0000 (UTC) X-FDA: 78768245010.28.06E0776 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 39DB9B0000A5 for ; Wed, 3 Nov 2021 17:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635959121; 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: in-reply-to:in-reply-to:references:references; bh=LgfOv5Fz6wLZvm6Rgi1f9KXwhG9hLdRO724+AjgnKSw=; b=BnmxznTY/AH43yORRb18tddVAZZCsVscALpfD9XpltM/yZAi1FCydr7kLp3LGyW7k4dBIP IWR7wDuOV2Gv4XcBLhCQY/Ucc5012hp24x7mUoLqabOMfkOzxglKRQaymQDyoNenREuZ76 BvBi2pgHIpXc3lxkBTRlOR0VbvIdSZ0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-FXn4m3UDNZ2ZbqGcncXAoA-1; Wed, 03 Nov 2021 13:05:20 -0400 X-MC-Unique: FXn4m3UDNZ2ZbqGcncXAoA-1 Received: by mail-wm1-f70.google.com with SMTP id 67-20020a1c0046000000b0032cd88916e5so1328288wma.6 for ; Wed, 03 Nov 2021 10:05:19 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=LgfOv5Fz6wLZvm6Rgi1f9KXwhG9hLdRO724+AjgnKSw=; b=ihwi5PtFkvU1kHLEiLKxg4x1QK+4KZoue5/rdkHQVT7Y6P6n1zy37h4eaCr+lZapBg Rhquvajv2mrhcQnfy0AAdFTcIabfM48qMwo+q1vNursBFLeJSmHdDAPKet7+8fUEZd10 DgKfAQeV2ZrkBFctuJdnFmUO9azYsjepOusU7Tw5R7/I30ZmxM7GqMYOxOpHLKgxYskd AGYCGk+3zTfHx/iFFDi89Dn1vcSSbiLjXTCL1oQspfrbfKi9WJXLPc1cV6tbdCgpuak4 ZUnZ189Vsg8g/fnuZak27UN/CXUZJJE7DMdZrj0ghj6v+3Y8KrEKSUc8zlqXFrckFHyB 7ACQ== X-Gm-Message-State: AOAM532Q3h836KdP2nBYRQ8hpw03r3FMd1kpl7Q2X+NPJ9m5q+/zxSa1 8+hda8MQWwFDwhl8kg2FgiJR0NXsJka/VJtkxarTLAbvnICqpyeLGM9bZwEVH0Gp0vu0izLopJn /Ok6paRZ8fNM= X-Received: by 2002:adf:8b41:: with SMTP id v1mr59256091wra.255.1635959118962; Wed, 03 Nov 2021 10:05:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBQcX8lYmzjC6CiT+zQNAvU5Ugr38t440jY6GVWANQUQa1Lk1Pj9neqCHeo0EkJT1jT+bnww== X-Received: by 2002:adf:8b41:: with SMTP id v1mr59256052wra.255.1635959118727; Wed, 03 Nov 2021 10:05:18 -0700 (PDT) Received: from vian.redhat.com ([2a0c:5a80:3c10:3400:3c70:6643:6e71:7eae]) by smtp.gmail.com with ESMTPSA id h22sm2900610wmq.14.2021.11.03.10.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 10:05:17 -0700 (PDT) From: Nicolas Saenz Julienne To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, frederic@kernel.org, tglx@linutronix.de, peterz@infradead.org, mtosatti@redhat.com, nilal@redhat.com, mgorman@suse.de, linux-rt-users@vger.kernel.org, vbabka@suse.cz, cl@linux.com, ppandit@redhat.com, Nicolas Saenz Julienne Subject: [PATCH v2 1/3] mm/page_alloc: Don't pass pfn to free_unref_page_commit() Date: Wed, 3 Nov 2021 18:05:10 +0100 Message-Id: <20211103170512.2745765-2-nsaenzju@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211103170512.2745765-1-nsaenzju@redhat.com> References: <20211103170512.2745765-1-nsaenzju@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Rspamd-Queue-Id: 39DB9B0000A5 X-Stat-Signature: wwucaj69r84au8ycxe8sm5xw79axhoyg Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BnmxznTY; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf19.hostedemail.com: domain of nsaenzju@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=nsaenzju@redhat.com X-Rspamd-Server: rspam01 X-HE-Tag: 1635959115-358638 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 --- 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 c5952749ad40..9ef03dfb8f95 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3355,8 +3355,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; @@ -3405,7 +3405,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); } @@ -3415,13 +3415,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; @@ -3437,15 +3437,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. @@ -3455,7 +3450,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