From patchwork Sun Mar 26 16:02:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 75114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1013643vqo; Sun, 26 Mar 2023 09:07:08 -0700 (PDT) X-Google-Smtp-Source: AKy350ZsHNu2K6nKKLfqlomMRs+G6lVU+viyOntCRAbYc6agL02sQ8RLe8ZJiUZmhSMB3DRnaCeK X-Received: by 2002:a17:902:d4c8:b0:1a1:ce05:9ba with SMTP id o8-20020a170902d4c800b001a1ce0509bamr11809481plg.52.1679846828512; Sun, 26 Mar 2023 09:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679846828; cv=none; d=google.com; s=arc-20160816; b=QzRCAKsoHggrzRIGfZPiIEaZlmAuwAT7aLsSaa7oweQ/iFmoWxSTZj8EAzTKWeAYDp XNXcTm0QwBprqQ5XU/o1euivZ/VRQm+X4/RPSVhh9JR0huXI4nVrJnuTrESlwfZCKQF7 PpzcfNhCgeiUqYpx8Rjau6eF2Y2aW3fOVbOU66XWg6HICD1oDxqvuSOmcB3MiRjI3fMs Dv37htAsHPEMlcnahwhPw+Bi5ndOdPwk7nJApc3nYKNRSc+4hHZjYx8ZT+EaojIOJs8+ NZkd5dZJZQsApSTWVYZDW30KL+vM2W/S+rh8IX9hdzZGfMuZ2qzpRn2/Cx2cPSwYxmAD Ob7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=lT0+AArYKubkn1XM/DfMkG+SVnDtAqp52SSaf3AbZO0=; b=zMt1m++l8SNWG4gQaCoshnd+iX1voOEdklTqoox1mHG2RAB0ycD6tT5raukfPuRMLI dlJ0/jTZHVNM9IVnRZ6NicppGzOty4cXbFF68F9F79XMjuH0NftEIQ0Ya9QQbtrMp2Ll rnMzqVGBzgu+phpDFu7NI5W8AIo6bpT4nLuX9FIW4mfP85BCOJVxB/PPwD37tSEF62Rv s7v1995kkevp7UEVDrN+Hsxl2LDiz7wEqChlEFWOgXWhYL89evXkeiTYF6Z8/omiZ7zN e2tHMTHWNbqsxWM9sMHEuF5TvToA8n7y7xZlZe3wMwz9FWq3Ya5urHyChbteWoP6ZeDA uMCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qHDHGNkH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg3-20020a056a02010300b0051352302c74si1034413pgb.7.2023.03.26.09.06.53; Sun, 26 Mar 2023 09:07:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qHDHGNkH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232501AbjCZQCb (ORCPT + 99 others); Sun, 26 Mar 2023 12:02:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbjCZQC3 (ORCPT ); Sun, 26 Mar 2023 12:02:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250F01708 for ; Sun, 26 Mar 2023 09:02:29 -0700 (PDT) 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 BFD9560F0D for ; Sun, 26 Mar 2023 16:02:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73BC9C433EF; Sun, 26 Mar 2023 16:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679846548; bh=5GI+UWw52yzkDB1j5DJoxEVt+0WJ22Fk+zngw5zbp2U=; h=From:To:Cc:Subject:Date:From; b=qHDHGNkH/Bk3FiM4UUc3BsWI2eljV2UOe3Q1efpMYxYQexeDVTryU0WViuapsTxxE BicCNXRtjfb/NkoeQzBD0JwbBf7z3KWpklROvxUyWyFRTjkGjB+DI10Gtqo5KEJHcB nkvYuSf2lpz1wjEXxNpH519Bt8VHzcXF95vGQFlsBxchOZI1V/GVEzslNi/Xmbzlbd BK+Q91Ymies/cbC01ULtEAwLGXRKT8uy0w4kK76uZZN+FUFZPYw04R+WuscwJOZa8w pjLJqFFIdGq4kLNqVzeEkGrvXV+M4Mrqktf8Q7deeDpwU7zXMpLYOGiVS76wbSUVC/ /ThU0pG9V8crQ== From: Mike Rapoport To: Andrew Morton Cc: Matthew Wilcox , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: move free_area_empty() to mm/internal.h Date: Sun, 26 Mar 2023 19:02:15 +0300 Message-Id: <20230326160215.2674531-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761447067615858917?= X-GMAIL-MSGID: =?utf-8?q?1761447067615858917?= From: "Mike Rapoport (IBM)" The free_area_empty() helper is only used inside mm/ so move it there to reduce noise in include/linux/mmzone.h Suggested-by: Matthew Wilcox (Oracle) Signed-off-by: Mike Rapoport (IBM) --- include/linux/mmzone.h | 5 ----- mm/internal.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) base-commit: 51551d71edbc998fd8c8afa7312db3d270f5998e diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 72837e019bd1..3ccada5e8799 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -110,11 +110,6 @@ struct free_area { unsigned long nr_free; }; -static inline bool free_area_empty(struct free_area *area, int migratetype) -{ - return list_empty(&area->free_list[migratetype]); -} - struct pglist_data; #ifdef CONFIG_NUMA diff --git a/mm/internal.h b/mm/internal.h index c05ad651b515..18cda26b8a92 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -517,6 +517,11 @@ void init_cma_reserved_pageblock(struct page *page); int find_suitable_fallback(struct free_area *area, unsigned int order, int migratetype, bool only_stealable, bool *can_steal); +static inline bool free_area_empty(struct free_area *area, int migratetype) +{ + return list_empty(&area->free_list[migratetype]); +} + /* * These three helpers classifies VMAs for virtual memory accounting. */