From patchwork Fri Jul 26 01:01:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13742349 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 67494C3DA49 for ; Fri, 26 Jul 2024 01:02:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B49296B008A; Thu, 25 Jul 2024 21:02:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AD0F36B009E; Thu, 25 Jul 2024 21:02:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 923546B00A0; Thu, 25 Jul 2024 21:02:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7124A6B008A for ; Thu, 25 Jul 2024 21:02:10 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1EA1481492 for ; Fri, 26 Jul 2024 01:02:10 +0000 (UTC) X-FDA: 82380102420.20.4F263D9 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by imf13.hostedemail.com (Postfix) with ESMTP id 743D02000E for ; Fri, 26 Jul 2024 01:02:07 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Ig/1PR2y"; spf=pass (imf13.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.180 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721955661; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=/r7gP43FjI2VkHBYMeY1hMMpUDOt5+Kq9suvJjcRdi8=; b=DYkEE2dIJIzDJQQJbw62Z8VDOO/y53Pt4GG+bfO/ldpcx6QjGyv2QmPGaKzKAbvIg+2taP +DRLdOUOanhjXm3gynTej5uz7m3bhCVNCIRrQIH+xzdkjDSwDc5BTv2GYLWDb8VThvMR2G t3w+Ho5YRHM3x0Dn985+bkhUyHrhSns= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="Ig/1PR2y"; spf=pass (imf13.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.180 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721955661; a=rsa-sha256; cv=none; b=vuu195nQFPYhSLLXhgb4i7puvO1wWDLYaJdh6oL6F/vZuLYvRbWTA2xW+wHwTPtPwXUBS1 dNL6/kALy1DuDq5vgNvL68FfVBxRJWA7gskP8BZuNDDuvsUiXnl5J09pjvPcxcz5O42CnJ se1rh7I3xyIcSQleZmM11J/Z0ikAzvg= Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2f025b94e07so8743501fa.0 for ; Thu, 25 Jul 2024 18:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721955726; x=1722560526; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/r7gP43FjI2VkHBYMeY1hMMpUDOt5+Kq9suvJjcRdi8=; b=Ig/1PR2ySjDOccW9/WfbRjvWbKtsLIlWUyOCVBOXd/DOVjLgGHamb8XaQVSPnqNoA5 o7hsxr5jXOjcr7wpvOxjN+kQ2LVvFCN/CGVt1P0z0RdAYddg0d2hyv4bCxlAjHw8br6C xMj/9Xg0LsTmlQ4QBszWkpGG1w957QoJS1aHVE9IDrnOtz+FwUGLjeyGsWNtvag/GbNM 2sVp2l4OpacKeoUQA07NpcQWaN8Qzk6CpUyKUA9S6cHPhRSUF74Yu0H2dStnUG8I3Wgf 50gMKAZK3x939Ub3+5/DUt1lTVfX7PRpIxKqY6tnCj3CGwb7+d96MRXqo3Ni4FNp+GIh ihXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721955726; x=1722560526; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/r7gP43FjI2VkHBYMeY1hMMpUDOt5+Kq9suvJjcRdi8=; b=DU8v+DPvdPOuUV09OpG14Qzq+woJGAk6t4UCEyKhO/AqT5bcIYRhZxQCAlfI5NXxmb B5HKBJLb/s8rj6qvI8azatVW4wj4OVtbwcKEx8F/wfIUJmbZB9FnRlZnu38a1DAljwLH ziQ/Q6Abs8LKXKAmC3xeEeCsH/9VIcaZvEFMQSrzkzIu4C68GpksRNXkXdKyDqO+4BtC 29nR5LNdI11vFSLUrm190//mrHN45VQ1C8qMgKC9SW3WwDxYIrmMcKN6hw7Y+cHx7h/b 73uqDI9L6AtZsY5+9D6kAlEHzRB4cbH93G6ouEufW7EcPkyjsNrm9k+phhGUfldxz3zi Lf+g== X-Gm-Message-State: AOJu0YybeFVJ9BaMHTBfbks8CwwkVqXv9xU38FXlk2tK2E0DL292YqDw xZey6eenmeo+4bI27BG6euL29HewaNrv/YZILywTq805PsNhw59D X-Google-Smtp-Source: AGHT+IHHORYSx5kwms+DWgxPd+xNf6otfb37APR5gas239WH9VFuve1qFIcxx3N9Kg8pvokuzuX9Nw== X-Received: by 2002:a2e:97c8:0:b0:2ef:265e:bb8b with SMTP id 38308e7fff4ca-2f03db7dd2dmr25532851fa.18.1721955725478; Thu, 25 Jul 2024 18:02:05 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac6377fc8asm1346540a12.39.2024.07.25.18.02.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jul 2024 18:02:04 -0700 (PDT) From: Wei Yang To: david@redhat.com, osalvador@suse.de, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang , Masahiro Yamada Subject: [PATCH] mm/memory_hotplug: get rid of __ref Date: Fri, 26 Jul 2024 01:01:57 +0000 Message-Id: <20240726010157.6177-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 743D02000E X-Stat-Signature: 5ijy4tbkr3hn5ih8zk8ze1zrbxta8h8g X-Rspam-User: X-HE-Tag: 1721955727-89086 X-HE-Meta: U2FsdGVkX1/rqg9TJUihwMFzW2zec+znPRSvecUpm5RDYEM2vCKLjscRCDHmIXZK9x5vTG1xUqn7HVUm11AIhzk8Jv8wshyFeWSh+U6lZF8p3oqTunWGG2m5O3SKF5AYp6zakBse++cVB7jWxxd8edi9rU1OCcSn0d1/er1UiKIAvDhJpMNTBIh2PwHQMZ07yLBEST6pEBK35Qja/jLVA/GT8YltpnkZ07ZXS7vYQRr0ee12kGjD1ZriIJ7nOfsY9bqR7qQGBwDSJZ4Ni1CF9oIwJpYV3pFCdn3/1MbfeSA/kQr7wOVJBZqbs/jydtt1MhUrZVOjHxxWIbtVXsfV3rOI+nR0APOTXMICl8b/7s1fjpthmwGgM3kuyl9XEkR65Grh/xUW9AbWXu5639AtVssr4x5f1Ri2rfBCXgCP2Xkq1i3WLWQBTtPXdRVfOqjXP35rY58gBjM3krAE99E5xBo6MjANLaCMrUF9NUaDlWxbO/1sry8iZHjHR2utuwY49IfutJIAdjX3VLXjO2wisXfy1mX6lcZFT6fmHegT7o36uHt7sbHYlWXk9cdtuwtH38q4FC8WxZ05Ccc6ekIj/Sheb1PbgW5aIDtZpgfZ0h+QLGelNoBQs3zg/yjaWej3tk0M0rX2FsLmSVcWcK2HVNQ1bTncH6h7+Elwxp28ZxqleGQz3Z5qPOwVkFqhomZ6ZBmBgIam5h6YkvP17tAV4pePAwhsO6aC2CbYBDLCDIdNAfzhUc3R49VPpnnIGK6oDamGz4G0QxzfRmyk0iAD/BzU+9Y/YpgmUKwlQ2QTNnN+Ale5uwctiDAttbEK3NPGRwTxGzb4Qm/013BAYn6/RPH4r0m72D/TPniB/cJuO7J9IR4jI5FGogNVPP/iyda+wlJHxIRso3CDmfxnMgMhSKeMN10by3UiCmtvlSK/xNF35TSgGAY45Wyu++F0nWoYsRnLanWbUymUq8mnyC9 qPgtcxZI SDhRl9BAPGmtk6M0369MhZnrG7dKfDgaNiUaIOD6GFvGuGkgA0kgVE6UTTgm904ci+qf+zF37oUOjk4ayTJmA9AFyPZ+tr4dCXSr5ZjaxhoVdVTO74wGtYk8MlHFQPK1/f9A0gLlS7gjuwnKVW9CGkpxLwMx6bsiQNZWPfSK0HapQGgssoDcyoE4KbKp/9qxgLzozvhgT/FBTJWsx2qRDDlHPApqnoa5bDgI/XZi0OesUcDtpWf5F2BGMZ9HZTwLCcxzAZA5MSIkm1kpGpnUIja1EmYzhwGagw/scLHyigFI74IiHKhWus0fwHYH4YFnf5Ji8fUzkvFdOFrDCk88W6zMbAxNpBIRY8hwWUb+gtHMTAd5Jy7BsD4ETza/QS/pzDFlCsOaUlc64cnE3STT2tO0cNMq2efUm3FH0aLKT4BWbIvYLgKps7A0kO0kVX2if43+Iz5eHklKp/ZrMJDIOWgRmw2YulHl6XsXvTJA2MB2stFuZhM1U3HW9/ic2w9sjB8+LQZl/7R5tp0hkffq5iBn7rIJxkziGCtJB 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: After commit 73db3abdca58 ("init/modpost: conditionally check section mismatch to __meminit*"), we can get rid of __ref annotations. Signed-off-by: Wei Yang CC: Masahiro Yamada CC: David Hildenbrand Acked-by: David Hildenbrand --- mm/memory_hotplug.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 66267c26ca1b..df291f2e509d 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -366,7 +366,7 @@ struct page *pfn_to_online_page(unsigned long pfn) } EXPORT_SYMBOL_GPL(pfn_to_online_page); -int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages, +int __add_pages(int nid, unsigned long pfn, unsigned long nr_pages, struct mhp_params *params) { const unsigned long end_pfn = pfn + nr_pages; @@ -524,7 +524,7 @@ static void update_pgdat_span(struct pglist_data *pgdat) pgdat->node_spanned_pages = node_end_pfn - node_start_pfn; } -void __ref remove_pfn_range_from_zone(struct zone *zone, +void remove_pfn_range_from_zone(struct zone *zone, unsigned long start_pfn, unsigned long nr_pages) { @@ -629,7 +629,7 @@ int restore_online_page_callback(online_page_callback_t callback) EXPORT_SYMBOL_GPL(restore_online_page_callback); /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ -void __ref generic_online_page(struct page *page, unsigned int order) +void generic_online_page(struct page *page, unsigned int order) { __free_pages_core(page, order, MEMINIT_HOTPLUG); } @@ -741,7 +741,7 @@ static inline void section_taint_zone_device(unsigned long pfn) * (usually MIGRATE_MOVABLE). Besides setting the migratetype, no related * zone stats (e.g., nr_isolate_pageblock) are touched. */ -void __ref move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn, +void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn, unsigned long nr_pages, struct vmem_altmap *altmap, int migratetype) { @@ -1143,7 +1143,7 @@ void mhp_deinit_memmap_on_memory(unsigned long pfn, unsigned long nr_pages) /* * Must be called with mem_hotplug_lock in write mode. */ -int __ref online_pages(unsigned long pfn, unsigned long nr_pages, +int online_pages(unsigned long pfn, unsigned long nr_pages, struct zone *zone, struct memory_group *group) { unsigned long flags; @@ -1233,7 +1233,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, } /* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ -static pg_data_t __ref *hotadd_init_pgdat(int nid) +static pg_data_t *hotadd_init_pgdat(int nid) { struct pglist_data *pgdat; @@ -1386,7 +1386,7 @@ bool mhp_supports_memmap_on_memory(void) } EXPORT_SYMBOL_GPL(mhp_supports_memmap_on_memory); -static void __ref remove_memory_blocks_and_altmaps(u64 start, u64 size) +static void remove_memory_blocks_and_altmaps(u64 start, u64 size) { unsigned long memblock_size = memory_block_size_bytes(); u64 cur_start; @@ -1473,7 +1473,7 @@ static int create_altmaps_and_memory_blocks(int nid, struct memory_group *group, * * we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ -int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) +int add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) { struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) }; enum memblock_flags memblock_flags = MEMBLOCK_NONE; @@ -1580,7 +1580,7 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) } /* requires device_hotplug_lock, see add_memory_resource() */ -int __ref __add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags) +int __add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags) { struct resource *res; int ret; @@ -1939,7 +1939,7 @@ static int count_system_ram_pages_cb(unsigned long start_pfn, /* * Must be called with mem_hotplug_lock in write mode. */ -int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages, +int offline_pages(unsigned long start_pfn, unsigned long nr_pages, struct zone *zone, struct memory_group *group) { const unsigned long end_pfn = start_pfn + nr_pages; @@ -2240,7 +2240,7 @@ static int memory_blocks_have_altmaps(u64 start, u64 size) return 1; } -static int __ref try_remove_memory(u64 start, u64 size) +static int try_remove_memory(u64 start, u64 size) { int rc, nid = NUMA_NO_NODE;