From patchwork Sat Jul 6 06:16:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 13725665 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 AAA3EC2BD09 for ; Sat, 6 Jul 2024 06:16:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 295EF6B0089; Sat, 6 Jul 2024 02:16:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 246356B0092; Sat, 6 Jul 2024 02:16:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1107A6B0095; Sat, 6 Jul 2024 02:16:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E12F76B0089 for ; Sat, 6 Jul 2024 02:16:27 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5F4CEA21A0 for ; Sat, 6 Jul 2024 06:16:27 +0000 (UTC) X-FDA: 82308318414.10.67EF365 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by imf25.hostedemail.com (Postfix) with ESMTP id B898CA0009 for ; Sat, 6 Jul 2024 06:16:25 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PwyWf7No; spf=pass (imf25.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 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=1720246565; 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=C30YDHvdcL1QHa74OtXiCvVe5ojMONXcsWNXWl0jcx0=; b=NDyjBrLHLI6LL8xbUq9ph+uVvJmywu6ywMcc6/uqDsC/QpTrOBDF6wz6MOPbWPpIKBX2Nh HYLb+c8duYoWUQgnZL79igpcR14pPyD3I0/SwJ/3CqLft2rLpPdNSx0HyB7oOFuBN69XPV jjB7KkjyfffThh4ZScudCkyiKSqs8m0= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=PwyWf7No; spf=pass (imf25.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.54 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=1720246565; a=rsa-sha256; cv=none; b=vFDFvuj1iPhS/lad1A+XpebfD4ctnZSDGs0rw4dERQWm62sJIwFzSVx/OKMSMLbcdU/dIi jeD/tNZ5detiytU+2gWJA3JUcUsYYqd9kHUyj2WOXkXaqtUpjRwNl0I2ftmb2h3GbqPhl4 X0eAmrLgvqkxRl5eiitxFlKKEVVXAV8= Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a77c7d3e8bcso171493666b.1 for ; Fri, 05 Jul 2024 23:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720246584; x=1720851384; darn=kvack.org; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C30YDHvdcL1QHa74OtXiCvVe5ojMONXcsWNXWl0jcx0=; b=PwyWf7Nor4Zqeihj+Ga3Gz1PXYtrAoAjgOfpSCguXMzfo0QPgKIed5zAsm8clCokh3 ztrJi/o67Z6ow2VQWcQAAby5uoe2R5DDlRXa2Uc05fEYKPySfTpMPowHPbf0SmGbWJdu 6WgM1oT/21uWQaV5Uir93+LPGsgkVo761e1FvNwKFrWF9PME6xSwSrbwBJp0pidthpaC eUaAVR0+PKJywuUgqMo1jHCuw3Aw625AFOSSm2AY/Wmk5eh4moTlUnZAKRW1sP+xtbTo PKOXQ84BVBSwnY9wCihhdkus4nKkLD+2HzPNsDwI3E5eUorxyCLBRvGI09vDYluecjgU KqBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720246584; x=1720851384; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C30YDHvdcL1QHa74OtXiCvVe5ojMONXcsWNXWl0jcx0=; b=nRVJQZsJBhQ5ovmGTOdrS9CDrjz0UC03oFd9aNcRDat0ISlr4bTDr1l4RS/tHNnpxk yG46xFDjH0RAbHN0/oUBnpoBa2MgliWfFYHCFRyYy7rmUulknlpmMXN/+iuc8Z7dBybf DKYSjTNb3Vj0ch0Q/r51HqfUpiyoJX8WLsUXBBY712X4vUUEvwL+XTCeUeU5mhHykk3/ uCOQbzGkHaDc2fsAIyIopnE+mDFZvgxvbZ8ECzjuqu5ESKmrmkO7PDYSXJPyHRyOGqMj vq4uxgGWEAKPCjPkZTOCqQNzdGzsYhpt/3Ut0ZwJlJHUiSK4pDH361q571/z+Q35AE14 1KgA== X-Gm-Message-State: AOJu0YwgrA33vTHcMPv0xwbNE+bsha8qUOT7zY3iP8Vp/OOD5/uUzczu KU5sLFkeATaBvyf0A3fu9j2aYH9J7JH6+jj021kQkTlX7KW4Wo+0 X-Google-Smtp-Source: AGHT+IF+c7A78WtGajLSHr+gS6wuXfSZk0CAMZLhosQVe18576OkDBXkLIC8+XLJb/trUYiehyM4tA== X-Received: by 2002:a17:906:578b:b0:a72:b803:a1ac with SMTP id a640c23a62f3a-a77ba70a6f6mr387273166b.56.1720246583734; Fri, 05 Jul 2024 23:16:23 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72ab0652d8sm742574766b.98.2024.07.05.23.16.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2024 23:16:23 -0700 (PDT) From: Wei Yang To: david@redhat.com, osalvador@suse.de, akpm@linux-foundation.org Cc: linux-mm@kvack.org, Wei Yang Subject: [PATCH] mm/page_alloc: put __free_pages_core() in __meminit section Date: Sat, 6 Jul 2024 06:16:15 +0000 Message-Id: <20240706061615.30322-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Stat-Signature: 9mrftwuqbzwuewctdqkzoaphokiyf6ap X-Rspam-User: X-Rspamd-Queue-Id: B898CA0009 X-Rspamd-Server: rspam02 X-HE-Tag: 1720246585-598209 X-HE-Meta: U2FsdGVkX1+NgHHbV42ZKD7ZvH6U5KxquGta+25gPbuGusZ8HzatGkWZTSqkMCigaynaAw2U7KEObtVAf//PQNe+l4QGY9TkAh1pHjA5Zd0aheCkFqNa1s9EAQ1GMEb/y5QMHHb0iGV5962BR1p8faKhpltgtTwpBKA9RAvsfP/uebmuOJWqSqvP11it1K+3G1kEQsoCzhup4qx9nOQCUXhS7Mquw+0JPHKMFBMA88DehsN68PKhHoPegramcsp6YaCckmu2E/UBRz1z0+nE2ntutC/aHgLhXljMjN/28+q8sTWm+j6urDvU0YXmt/7+mYAi3mNEm3w+S/WZKpDaku+nufdb7LZICRgpuAF6kAPxA3gnd8ybHJZS6KVCnTKVwcDTwhoSYnVmvtN8wojQU+3T/pD6TYAwf5TfqoR8O9pn0zm2LUYwN6l54Cz2u6Oo0X1fpd4OMyk5Bgaum8SLN2f/OuA/z9BABzcR/tyxgBFvWF1Jqyy8sZXBekEBwxmDLVyU1ojsxMAR+wi551BIFlAtcl7B00Qy8AsSRnIgRRTnDlXMIFAo7Z4KQDQNFvIaiXzl1AoveDT2fOQS2eSC06P8stXKVwwjsRFN4rb7I4FI6gc0A8XSNCUbSQ20dRBNsX3ry2/PUAPeI5xmAQo8Ljlba5ItTnhkCHkQe5bwQzmz7AlPXLImqJlkQGxTUX/RoTE0HbeelbWDNja28u0NbQob14CoPzlsvbyWYlvuLuZVgAwutdr9Je3HlAXh51XS6JECg956Wz3m5+1ONhdP2Sox/DbdsIiAUNhbvLX2v+269gg/F26O6P5avDnPJV5sqxf0mQPFDsOV7kI6XfLYZiZZ46YB7Nz7jDDomAqBHhlTxt27SEkqbwzPD27egXXe87qgF0gsTFpOUjqy5svlev8K7IJCpG/bV399jdqEprJjij/ayFeQOr2zrOdpD4lx9XEymVQ1yZu4PjVO6f/ Fy9SRUJS r2NqLFD0sooQiWI5h5ghHKa+zLTzgHtLOIa6TqhTse8AO9YXu5YPl5xpdviMjyJaO+WjKriO2HCufXMjFom+YCA+XDuabxrj+XiGe8BfcGbhimga1E8S9wlt2c1eylnTo6Ehffjf8PJ0sbCKMZSTSA/MBNs9hmW9Zhv30tv6JnVS3D8HTVuGE+BzusXdh8a0DyptzKC7Stg/B9+vAgyrNOKMikQZkrlSRnYG2tarfUnkCmLgrC3t0K/H9AzV11P2Ux5K73iM3PEZtra7fVIKue5OAOg93aMatdY+0txYQr2WS3VOR4vqM55TIeChrLcC8PZke5LEdjmXQjKWbnCLFcjCnWztUKTUd/lbiY5sDMgKxpzRvpk8umR0RBmNgHg4JontaL3KZu+YZGcgyPSbWOr+XkUyp9sbPpioXy+o+ILBxqPgr5dACMqfUnzXNwr6TiVugL34Nyv5ZjoY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000656, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Function __free_pages_core() is only used in bootmem init and hot-add memory init path. Let's put it in __meminit section. Signed-off-by: Wei Yang --- mm/memory_hotplug.c | 3 ++- mm/page_alloc.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index fae1da27f0d7..66267c26ca1b 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -628,7 +628,8 @@ int restore_online_page_callback(online_page_callback_t callback) } EXPORT_SYMBOL_GPL(restore_online_page_callback); -void generic_online_page(struct page *page, unsigned int order) +/* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */ +void __ref generic_online_page(struct page *page, unsigned int order) { __free_pages_core(page, order, MEMINIT_HOTPLUG); } diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3f3d83def9be..116ee33fd1ce 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1219,7 +1219,7 @@ static void __free_pages_ok(struct page *page, unsigned int order, __count_vm_events(PGFREE, 1 << order); } -void __free_pages_core(struct page *page, unsigned int order, +void __meminit __free_pages_core(struct page *page, unsigned int order, enum meminit_context context) { unsigned int nr_pages = 1 << order;