From patchwork Sun Mar 19 11:42:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13180308 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 5547AC6FD1F for ; Sun, 19 Mar 2023 11:42:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AFC16B0074; Sun, 19 Mar 2023 07:42:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 660476B0075; Sun, 19 Mar 2023 07:42:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54E6C6B0078; Sun, 19 Mar 2023 07:42:31 -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 44A9C6B0074 for ; Sun, 19 Mar 2023 07:42:31 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 0BB78C07DA for ; Sun, 19 Mar 2023 11:42:31 +0000 (UTC) X-FDA: 80585460102.16.3C5DE6F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 6DCA2C0019 for ; Sun, 19 Mar 2023 11:42:28 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jpHhyinU; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679226148; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=RnK/IYBHQhIgmpLQg3WmPvJSxa6uUptn8+BLsoQU1lk=; b=S14+wT0FqdfK6t0vy+gPwCnfgEAud8x6HDAlr13EmpNUUqzecJE57jcyYsUt0nckOZUFbz BiNdVzwzHWO2jdMtNrTLvPcikMYEUZ41S0PYLgtnSRmpwFHuNMlr8wOpGTYUJS/UmXH7wg KZlOMX4Iy6Cbc9viGnDGnXm+iDix4yE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jpHhyinU; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679226148; a=rsa-sha256; cv=none; b=UWRj8l+ds0XThf+dQ7lPGa5mZXEMowXwsGP1r+3xcH02xVxJCaFDaAfOdCMgKV1zkNHr3G 8a04E7elglaC6+7pEVYmsYzfwQWaFNCcZrjIwxiInlEYoN4ipvA+mixvMYhb+cLE7O9Qx7 I/cd9CcS2F/1tE9lfZv9J6mJWbzvUjA= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 682C160FD1; Sun, 19 Mar 2023 11:42:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9254C433D2; Sun, 19 Mar 2023 11:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679226146; bh=3Ae5b1cM6n8dUopEW2/hVH5kWClmHMJCBK1/s5YMwP0=; h=From:To:Cc:Subject:Date:From; b=jpHhyinUPVEMDa7Bt5tUDUQt7uPQvb5YR+li6BaYImkNbTNB9nCB17Bc0d6npSG7H cmuw83vRra+IXFNs0Wqb44B2bvoXZPRrXSYHsAd3pxaPTiElPKRNCc2QXRWak00OPG 8Y/AsZ7gmwKX65vkZsOeQPWF4A6bF89ey4ZNC3UxGjcq9PDJw3bENhEoq/xJurnf3+ bXxrB5OqDODukOS0mC75E0s/JjNPD7oMTH5899IMPU4mYDmhJudZtojJrCFwmlX8W9 M5QPhU7GYiVABKK6xnM86y+cCsrT0O6H+SJh33AL77vAXcuTsFt7p1bkqTQdkRJ3e+ WYDqYPiWMnK5Q== From: Mike Rapoport To: Andrew Morton Cc: Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: move get_page_from_free_area() to mm/page_alloc.c Date: Sun, 19 Mar 2023 13:42:14 +0200 Message-Id: <20230319114214.2133332-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 6DCA2C0019 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: bsf34bp8s1t6c4ny5tgsu1qyr9ixfzx9 X-HE-Tag: 1679226148-954085 X-HE-Meta: U2FsdGVkX18LnwGqLoMkNBSSYEcsRHB2rBoCxPtwYK39PlzY6OlU5u9nYitOwbkIcSHw/o3LSZ/PngUo/5g4lTnlp40LibOrWLRgq+nBchMSpFXKAVULrzn7Mx4Q9+SPqWVgDbiqnhhH+lyKQpIqPNYeBkNgPi8oE0k1hok8XcQiIDy7FIRQwpSwvgR3TekmLIcIr8jPVVKHcFS1jIVFB7TslJizuIc7R47A4RIOIelazpfK4YnciokZ+Xfw8+pFrUrQhOPJSgQVnxLsJa2zKTdTmSu3rwmQrLKeRo6laE5yRzB5T5jGV2hqi87hhdufjtL8U7bsbgq8Hina/MaDejcuGMAGxuJ3kXQG0jZP6NUqM/WlHymtXS/DOa+oN1Xtxp3+F4L25fKTmiSwmXeVNxaEEIX4fFulWrptIzZSixz8kKfLFcJPzQe0Dej8IV7PCk+BGFjjicV+dvMgeS218ae5PURDOfw9+VOy+wbvvwx1xjaYER5FagoqwCBBXJPIrovkggsU1IPmXvb/VblJ0wiGShk+Vr00Iqo0yindQgQ6cRmnMFVkRnngQDz/YYYz+afFOTsetfHN9d+bYCUAqn0x4VghTU/HSy611+ioS8CyD4LD/OhKBkjtcZBsahoGuSOV+MCDKGe0h1ap5Qh+FCIWfi/gMG3bROqYQ6olZAALaRab4EWMm2liNw9BdMWVtuqYitI1bJPZbvDki24FlQO7zBcnpzCK0gEP54ywZIley5fB02RSrGF+DdImodTFha+1RMe+zt3ydfS0QoqIYB8+uoinRAjuHYDT4MAqbT4uB0wWTq3V+1Ycp1Cwh1kl212jPTZM2tYmWBhTp00u0wkAB8yCX3B9VJu3IjDqHPvqlUMeAuLHWZTQpcJkWJzIWtbrhAVLtgVd05UNB0G8Q7jpRA0jXjmy9ZsX1EGHKF74ZKquuRYdFsvKs5cXfhGj++tBKeyrEenTtbI7PLS wlrhw9dk rf1rXCQqV7LWFISzQrHI7oy494J5iKm9fBAjc7Hv7u98VMCl8L8ybTsv0gMF1o/ulfYozLCLSBeeyY+Ii565r/LB2Knr0UxKF5DY6PHIJKbErkpeR4OnBwCZedvx65Jmuffk2MxvwVFkTbYsNVXfklXQUDUc5Ndlf0F4bVPi5aKFQbAC7zeg1416L6SzqmTAIczw6bJRA81ZIwxKMAasXLLdQsx9bkBavZl5AJa6vgnhe+7scHPpirUM5xYT5J/7EOC5xrtoqo5NytsLGUhNakOkoUxh1fbD6mlzmayrUweACcOphriVHv16O1EfledLj5iZMuROOoNMWWPcfMeAO09qe/s1+p9kahB96OH9DEXq9IjWl7zQgG6bSQVkSmq0558ASFZJptLUdYaUQ4HMADxADzg== 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: From: "Mike Rapoport (IBM)" The get_page_from_free_area() helper is only used in mm/page_alloc.c so move it there to reduce noise in include/linux/mmzone.h Signed-off-by: Mike Rapoport (IBM) Reviewed-by: Lorenzo Stoakes Acked-by: Kirill A. Shutemov Reviewed-by: Matthew Wilcox (Oracle) --- include/linux/mmzone.h | 7 ------- mm/page_alloc.c | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) base-commit: 4018ab1f7cec061b8425737328edefebdc0ab832 diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 96599cb9eb62..8f5a9e2c722a 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -108,13 +108,6 @@ struct free_area { unsigned long nr_free; }; -static inline struct page *get_page_from_free_area(struct free_area *area, - int migratetype) -{ - return list_first_entry_or_null(&area->free_list[migratetype], - struct page, lru); -} - static inline bool free_area_empty(struct free_area *area, int migratetype) { return list_empty(&area->free_list[migratetype]); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 87d760236dba..2e72fdbdd8db 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1048,6 +1048,13 @@ static inline void del_page_from_free_list(struct page *page, struct zone *zone, zone->free_area[order].nr_free--; } +static inline struct page *get_page_from_free_area(struct free_area *area, + int migratetype) +{ + return list_first_entry_or_null(&area->free_list[migratetype], + struct page, lru); +} + /* * If this is not the largest possible page, check if the buddy * of the next-highest order is free. If it is, it's possible