From patchwork Wed Mar 27 18:58:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 13607294 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 AFA17C54E67 for ; Wed, 27 Mar 2024 18:58:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27DE56B008C; Wed, 27 Mar 2024 14:58:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 22E6E6B0092; Wed, 27 Mar 2024 14:58:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CF166B0095; Wed, 27 Mar 2024 14:58:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E1D7A6B008C for ; Wed, 27 Mar 2024 14:58:35 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5574E1C0ABB for ; Wed, 27 Mar 2024 18:58:35 +0000 (UTC) X-FDA: 81943730190.15.08E03B9 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by imf12.hostedemail.com (Postfix) with ESMTP id 73C8840004 for ; Wed, 27 Mar 2024 18:58:33 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=nKA9qUPt; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.169 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711565913; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5+6/z6Iu03sZnSDjOG6ZOICRhEOxeVPmVmqIOYHqAQQ=; b=1YBpdhKCj30rcV3HMys0LjApfBz34J47+2ySns+LwGWWP/5Im8acPYe01UnUmr2S4rDbiK /NEZJ4GTRwhiPJCBwof9kTgyleSfgFClOUbw0Zygq9VCTf+ktXZsbhx9PlBuyKJ/WdPHUd 1Gg8eJeRC217Y6JqpEsiu+squFt+KAE= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=nKA9qUPt; dmarc=pass (policy=none) header.from=cmpxchg.org; spf=pass (imf12.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.222.169 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711565913; a=rsa-sha256; cv=none; b=vsDufAO2+IAdS8Wh3s590HRFQWndDdHRjrFE4fsB3xlc24lS8BTm+UBctvJr+qiS8n+yhK Pqu1BzY1L4EtPy0Qy4YludB/0d2nZpluqA/a7l6kp65DVMBHFuKM3MTkwlE5j1Ahrutp9Z ZwixIBYLIVMrsy/MOrSsk/ykxMpmbRw= Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-789ddcd57f4so5475885a.2 for ; Wed, 27 Mar 2024 11:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1711565912; x=1712170712; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5+6/z6Iu03sZnSDjOG6ZOICRhEOxeVPmVmqIOYHqAQQ=; b=nKA9qUPtMdA0Ms2SZe+THwvo3FyTjZbKdr3XXf/D/Xt0S1ymJ5OJjhhD5w9WhUkvMU Oaiv1wnDeWa6VdKPaG6Qg/9aMi8UG1aD63VFfH6nv3q/sDTlaKTqNPcqhzHge5Dl86aZ HMHKtiJf2cEt+pu9HKjw5cwWTUbQXctyvFHJJ8L/+LnfY0Vf8hXZvbB7ZMVZzW+DkPFE 7g0hOdEi6oaVBRiNWBgQ4DAay73GHc4TBqntjqmjCnP438UECWB7MznZ2m201bzGx/eZ pAebOTjbRv7IoDGCF6VpcNDZRkC4GAOL8hULhalX8hPsZkmfECElsku9NGtWBXUbs+jk oFCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711565912; x=1712170712; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5+6/z6Iu03sZnSDjOG6ZOICRhEOxeVPmVmqIOYHqAQQ=; b=WdSXyMoZySNsI0uTZH4K9sVBRbkofZw/G+3iwi75t4nhGxjnnZpLOxzF+wPu+EBHug mXYi8FD3mIkJVVsuTMafWlaA+gO326gE2ZvX6ZCTjCMtC77Mu5fm3URhwnrPyNfzQjP9 2nOtlnUKF7XyDQOAbdRFjOnE0ABBgiYIpDW0r3hFmoxco/63HdwHmztXiFZ6Szmao+UP ah8xTwjBHElPmVvK0Q0GwGNTynGXFYFmEKkpIOCl+KEin7BiIyMR/j+jlkcJydWvZxjB bSil5azo/BqJIYcuXrHageKEYctaZfK4lipQ8P1n5Lclyp573Wk4ecu36EwI6rU2cFxt P56w== X-Forwarded-Encrypted: i=1; AJvYcCUO+H/k8+zeN96YMHsY+sHp8FprMzwtoW0O2dc4hkfNo0pMLLiytFsOaT3RuV6UaB2JL4+lyuvXdJ8lBEd5O7Wqo1Y= X-Gm-Message-State: AOJu0Yz890leb7vZXB/iJUtxiAxNdXQpUO444/ZohPBGqRwOiUZaGnYT /ujGESpHo/+07dvWO36BAixmXmlurNEUXSeGeQ9HOA4HjOK4KRML0Pvc6QbzfZg= X-Google-Smtp-Source: AGHT+IFMX86LnLj/Jckkj0IDbpKUIbE2+GQj4be5JSr0OrjfUwBsujcYelDxsMjtbJtNCeNV8Jvubg== X-Received: by 2002:a05:620a:44c4:b0:789:eeb7:2273 with SMTP id y4-20020a05620a44c400b00789eeb72273mr480031qkp.49.1711565912546; Wed, 27 Mar 2024 11:58:32 -0700 (PDT) Received: from localhost (2603-7000-0c01-2716-da5e-d3ff-fee7-26e7.res6.spectrum.com. [2603:7000:c01:2716:da5e:d3ff:fee7:26e7]) by smtp.gmail.com with ESMTPSA id cx7-20020a05620a51c700b007884a54ffb1sm4077907qkb.135.2024.03.27.11.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 11:58:32 -0700 (PDT) Date: Wed, 27 Mar 2024 14:58:31 -0400 From: Johannes Weiner To: Vlastimil Babka Cc: Andrew Morton , Mel Gorman , Zi Yan , "Huang, Ying" , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] mm: page_alloc: consolidate free page accounting fix 2 Message-ID: <20240327185831.GB7597@cmpxchg.org> References: <20240320180429.678181-1-hannes@cmpxchg.org> <20240320180429.678181-11-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Stat-Signature: hibe8d7pu9syuaqudb6zh7msq46q8ipb X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 73C8840004 X-HE-Tag: 1711565913-287232 X-HE-Meta: U2FsdGVkX1+0G0Fcr2OlS04h3BCVr2Qudz00TUs7YqeLu7+Rzg+Iq86Na7i65NPV8+DHY1e7utpUfv4DsIJ0C4wQ7DAhiY7QgaoqRhvkKJqk8g8k6eKL2tmLtsVrvezByqJKqAcB3GO44C4HgHFhYiRqMzb8G6bL+xjKm3qW2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UjsNGp6uFzv7vus5mCeZIn+zxBJm11zEpP8Ja0xGR1vDG2KvZP0cyzInMehZfwaST7yrJrgLm0jKvdZv7GIyTIF1u8Ds9e8ZRnHZxQrKtdKvyfTMpUdezT3Vo0A95unDn52CfqIPKIcZWHYo5zH0jYMiZMe8bF9v2OrvVtrCN6ntQye0j4wriFApcASMiwQ2psNdd79T+7fV0pvCvaJWsWntF8qaZAMz2xOXuJXfrYhcRPZICyGl/5POYOKCqk 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: List-Subscribe: List-Unsubscribe: From d3a0b6847f8bf1ecfa6b08c758dfa5a86cfb18b8 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Wed, 27 Mar 2024 12:28:41 -0400 Subject: [PATCH 2/3] mm: page_alloc: consolidate free page accounting fix 2 remove unused page parameter from account_freepages() Signed-off-by: Johannes Weiner --- mm/page_alloc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 34c84ef16b66..8987e8869f6d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -643,8 +643,8 @@ compaction_capture(struct capture_control *capc, struct page *page, } #endif /* CONFIG_COMPACTION */ -static inline void account_freepages(struct page *page, struct zone *zone, - int nr_pages, int migratetype) +static inline void account_freepages(struct zone *zone, int nr_pages, + int migratetype) { if (is_migrate_isolate(migratetype)) return; @@ -678,7 +678,7 @@ static inline void add_to_free_list(struct page *page, struct zone *zone, bool tail) { __add_to_free_list(page, zone, order, migratetype, tail); - account_freepages(page, zone, 1 << order, migratetype); + account_freepages(zone, 1 << order, migratetype); } /* @@ -698,8 +698,8 @@ static inline void move_to_free_list(struct page *page, struct zone *zone, list_move_tail(&page->buddy_list, &area->free_list[new_mt]); - account_freepages(page, zone, -(1 << order), old_mt); - account_freepages(page, zone, 1 << order, new_mt); + account_freepages(zone, -(1 << order), old_mt); + account_freepages(zone, 1 << order, new_mt); } static inline void __del_page_from_free_list(struct page *page, struct zone *zone, @@ -723,7 +723,7 @@ static inline void del_page_from_free_list(struct page *page, struct zone *zone, unsigned int order, int migratetype) { __del_page_from_free_list(page, zone, order, migratetype); - account_freepages(page, zone, -(1 << order), migratetype); + account_freepages(zone, -(1 << order), migratetype); } static inline struct page *get_page_from_free_area(struct free_area *area, @@ -800,7 +800,7 @@ static inline void __free_one_page(struct page *page, VM_BUG_ON_PAGE(pfn & ((1 << order) - 1), page); VM_BUG_ON_PAGE(bad_range(zone, page), page); - account_freepages(page, zone, 1 << order, migratetype); + account_freepages(zone, 1 << order, migratetype); while (order < MAX_PAGE_ORDER) { int buddy_mt = migratetype; @@ -6930,7 +6930,7 @@ static bool try_to_accept_memory_one(struct zone *zone) list_del(&page->lru); last = list_empty(&zone->unaccepted_pages); - account_freepages(page, zone, -MAX_ORDER_NR_PAGES, MIGRATE_MOVABLE); + account_freepages(zone, -MAX_ORDER_NR_PAGES, MIGRATE_MOVABLE); __mod_zone_page_state(zone, NR_UNACCEPTED, -MAX_ORDER_NR_PAGES); spin_unlock_irqrestore(&zone->lock, flags); @@ -6982,7 +6982,7 @@ static bool __free_unaccepted(struct page *page) spin_lock_irqsave(&zone->lock, flags); first = list_empty(&zone->unaccepted_pages); list_add_tail(&page->lru, &zone->unaccepted_pages); - account_freepages(page, zone, MAX_ORDER_NR_PAGES, MIGRATE_MOVABLE); + account_freepages(zone, MAX_ORDER_NR_PAGES, MIGRATE_MOVABLE); __mod_zone_page_state(zone, NR_UNACCEPTED, MAX_ORDER_NR_PAGES); spin_unlock_irqrestore(&zone->lock, flags);