From patchwork Wed Jul 17 21:28:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13735808 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 B5771C3DA5D for ; Wed, 17 Jul 2024 21:28:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3EDE56B00A8; Wed, 17 Jul 2024 17:28:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3768F6B00B5; Wed, 17 Jul 2024 17:28:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C8926B00B6; Wed, 17 Jul 2024 17:28:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EE9C36B00A8 for ; Wed, 17 Jul 2024 17:28:49 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A6B9512186C for ; Wed, 17 Jul 2024 21:28:49 +0000 (UTC) X-FDA: 82350534378.30.403FD80 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf21.hostedemail.com (Postfix) with ESMTP id 07DF11C000E for ; Wed, 17 Jul 2024 21:28:47 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=zFcpq0da; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of 3jzeYZgYKCJoMOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3jzeYZgYKCJoMOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721251695; a=rsa-sha256; cv=none; b=u3u9kg2Tf3ZacakSxB8VCbo5wiyvSicaciwOamFjjeIAIaMlsJm/sn7SvXgJNz82uSEEYo bhxbz4A0roSEmW9v9BF1dGe22EHLe+URpcfKBBts2WR+MxYndLUiyr/1GB9xDM04yFUKca nIfvnNZn4oAB/XTTELTDyD/X99MQtcg= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=zFcpq0da; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of 3jzeYZgYKCJoMOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3jzeYZgYKCJoMOL8H5AIIAF8.6IGFCHOR-GGEP46E.ILA@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721251695; 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: references:dkim-signature; bh=bC1XYrE8D3FwqV+dReridNcLxNzpjkdxcOvL08MCL8A=; b=0oO6ud1tdNlJjLr9GjKr0ZRhT2sJlYhsYIgfyDf5nx38FY7nJuIn8cv1ix9a8xdL2SxUwx jxA9LlSHsY2NTC9j2w8jk1XIRMFApDrLfX8gNRRWts78yQgya3BFIZ2sdW0FXRvWIH47hJ 4jOk6mdEoA90S7Nn7HlsjmBaKXqK8cs= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6511c587946so2388477b3.1 for ; Wed, 17 Jul 2024 14:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721251727; x=1721856527; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=bC1XYrE8D3FwqV+dReridNcLxNzpjkdxcOvL08MCL8A=; b=zFcpq0dav81iroH058OtA+ma43okc1OxT6VTmrUeaS5QPL/A3mHq6Pl0E5///Ok6VM tXFA5jEJHrnDCI9oXYZ/o6azibx+YbMUXPsiRBVbkLUrVxrxN03nPdoN7cGq0urdwCmd oQ+megTpKk5yJiZQcMm/fhX196YZB71pVDFhp1AnTix2cmGOpVs/jFnNhZs0FXbr5ibI U6afIuzHHc4Ec95at+ex7cm6uSVily/50gwypsnE/4hgC4gyZ6TvJIaJBwqukSjdFxOb +HyjJ/JZ5tHc+I8BCKvjunCRtP/VhqqAEmde9HzhXa8TckEIaL74KDq0zlCC5qRB2XGu JWwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721251727; x=1721856527; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bC1XYrE8D3FwqV+dReridNcLxNzpjkdxcOvL08MCL8A=; b=PNeIXO3GgtgFF6pKFk+Ud07gOihA5g4LkS7KyaPRESQ8bBfRb9fDOHJkrutlCuyU2W 1m5x4l3fA6XrzjFwVV8FGHJUIpLWDegSXj+ao3gHkxtPYmelpUc8B4YfxU9PlgVvSWOg XfKNo2oFUWWzJey9jocDVg+UcIJcBNUZ6yvylhpcYjj42rG7ZMUnKZ5zyUBOeCJmoYFL ddZ73XqDAB2IxdT8FsLBaXq6CzNDotx2u4bdySePds8NA4/XzIEfVBXUA+lDWJ8GyfCt CGydypmXZINZrvS+nkFSGrZ0SQte771GW2ZJFqBsdpYRjKiqyHVsYyyvQTZMw8RJlYYy khYA== X-Forwarded-Encrypted: i=1; AJvYcCX4x9AJMUghHi2WRpvpr4/WvcbFmhW4KuckFrx6KmtzwldMntLc73PnYtHZ/vuq6vqrYCMNsgyLJWpzIjeYbymGci0= X-Gm-Message-State: AOJu0Yy174VUJjPzS39H6Qv6rpDbYMKWGOMiOE667nxpGakNek4bpB42 9aKHa/H2H0PX7oJOr5yoAXDAvzFb4N/itmilmPax5WvHKp7ipWWCkeq3ouXn4SRiw+RCCDGwKKd hVg== X-Google-Smtp-Source: AGHT+IFLgB2C6j0dFHpvLIU7N8gDZUpXVn/57H01SUptIZ7LA4eVWYxCTx/3TCCmKxlLkZBSM9SJzGCH+/E= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:f44b:e467:5c7c:74ab]) (user=surenb job=sendgmr) by 2002:a05:690c:d8d:b0:62f:f535:f2c with SMTP id 00721157ae682-6660248e324mr151227b3.2.1721251727081; Wed, 17 Jul 2024 14:28:47 -0700 (PDT) Date: Wed, 17 Jul 2024 14:28:44 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog Message-ID: <20240717212844.2749975-1-surenb@google.com> Subject: [PATCH v3 1/1] alloc_tag: outline and export free_reserved_page() From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, hch@infradead.org, vbabka@suse.cz, pasha.tatashin@soleen.com, souravpanda@google.com, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, surenb@google.com, kernel test robot , stable@vger.kernel.org X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 07DF11C000E X-Stat-Signature: q6a8f1q7ctswezikng8bbri4j6i1h316 X-Rspam-User: X-HE-Tag: 1721251727-122870 X-HE-Meta: U2FsdGVkX19TgZ2X7oaTODUUD4gquKPhXyoZT96roGStXcrtQ9swhYeaSCVx9LjzL1rxf9tIhWvtQ6rwC1peat2rvaTGQLX4Zrl6UStdrPXGLlRITd5iz5jQr1JT3yFLMJrQYHf9Ii6HLCsGzRA2DuLxUc9FDxqOGTiQmXMx5P1AMrcYJxvnXtWq+1GTue9mv/frgi2DMC6oTUNSC4/NfXZnF4RPjuD/EHjO8jSx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8mYwDOPMfYNTXHuHmtDkZlgm2/Op61AV7idusLQMjqxHgrCFSU+hOgK9B6Xm/PDhdO5FpcbXSAwmfqWdGzTcHXori9EWSJ0B1CJ/KPt2XKJbXGcmOVeWPq4VXqH9mMdtdEiIvn1rZo9NDA16BF3xO6RKcY57VEOCMYv+G8Ol6zuQNo31XN3fmh5iYhKJq/Xer0EN3mmmNRAJXV+qNYpCNtQVa4PU/ASFA+sGqTK/aZvXSGPQmmNOpwMKbGakjkCjDvr99FiSgaGExhFXO6JXOYnY0H11H3kMv3Bcl29X6fcjSoJ3WEgXjHPI9qzThrgX6ZmVzM5aRemDxZ9Iq89/fy6K/AmZEuP2DgLX5BwQsFfaOvE3/p4aF1nwgi7lrazstNn/4V 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: Outline and export free_reserved_page() because modules use it and it in turn uses page_ext_{get|put} which should not be exported. The same result could be obtained by outlining {get|put}_page_tag_ref() but that would have higher performance impact as these functions are used in more performance critical paths. Fixes: dcfe378c81f7 ("lib: introduce support for page allocation tagging") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202407080044.DWMC9N9I-lkp@intel.com/ Suggested-by: Christoph Hellwig Suggested-by: Vlastimil Babka Signed-off-by: Suren Baghdasaryan Acked-by: Vlastimil Babka Cc: stable@vger.kernel.org # v6.10 --- Changes since v2 [1] - Dropped the first unnecessary patch from the patchset, per Vlastimil Babka - Added Acked-by, per Vlastimil Babka - CC'ed stable@, per Vlastimil Babka [1] https://lore.kernel.org/all/20240717181239.2510054-1-surenb@google.com/ include/linux/mm.h | 16 +--------------- mm/page_alloc.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) base-commit: e2f710f97f3544df08ebe608c8157536e0ffb494 diff --git a/include/linux/mm.h b/include/linux/mm.h index eb7c96d24ac0..b58bad248eef 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3177,21 +3177,7 @@ extern void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid); /* Free the reserved page into the buddy system, so it gets managed. */ -static inline void free_reserved_page(struct page *page) -{ - if (mem_alloc_profiling_enabled()) { - union codetag_ref *ref = get_page_tag_ref(page); - - if (ref) { - set_codetag_empty(ref); - put_page_tag_ref(ref); - } - } - ClearPageReserved(page); - init_page_count(page); - __free_page(page); - adjust_managed_page_count(page, 1); -} +void free_reserved_page(struct page *page); #define free_highmem_page(page) free_reserved_page(page) static inline void mark_page_reserved(struct page *page) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9ecf99190ea2..7d2fa9f5e750 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5805,6 +5805,23 @@ unsigned long free_reserved_area(void *start, void *end, int poison, const char return pages; } +void free_reserved_page(struct page *page) +{ + if (mem_alloc_profiling_enabled()) { + union codetag_ref *ref = get_page_tag_ref(page); + + if (ref) { + set_codetag_empty(ref); + put_page_tag_ref(ref); + } + } + ClearPageReserved(page); + init_page_count(page); + __free_page(page); + adjust_managed_page_count(page, 1); +} +EXPORT_SYMBOL(free_reserved_page); + static int page_alloc_cpu_dead(unsigned int cpu) { struct zone *zone;