From patchwork Mon Sep 2 04:41:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13786705 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 A4BB8CD3427 for ; Mon, 2 Sep 2024 04:41:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DFD678D0071; Mon, 2 Sep 2024 00:41:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D84ED8D0065; Mon, 2 Sep 2024 00:41:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B3A138D0071; Mon, 2 Sep 2024 00:41:45 -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 951138D0065 for ; Mon, 2 Sep 2024 00:41:45 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4A3AB121A2B for ; Mon, 2 Sep 2024 04:41:45 +0000 (UTC) X-FDA: 82518550170.01.40BFA82 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf18.hostedemail.com (Postfix) with ESMTP id 859E51C000F for ; Mon, 2 Sep 2024 04:41:43 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=XgAMbi2x; spf=pass (imf18.hostedemail.com: domain of 3BkLVZgYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3BkLVZgYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725252010; 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:in-reply-to:references:references:dkim-signature; bh=jIAzqL0tmqWuUadipZSgPIzfdbVk1YeOcL9yjZr6O/Q=; b=j8KOnao+8pWZOyUkHcSdaG/3gIjZDYGdv6DGtOavj0rPd6kQFKVq/AsMsHj6/CS0MVsU09 aQnm/kKNfG0lwcJF9bRSpB2znzkzzOLpYybEoMVSSW0Gr5W1DXQP5qoV6B8CIJxawJhY77 SNBMVsxyYT9+8iYijyjH5RztzVNXrbg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725252010; a=rsa-sha256; cv=none; b=HynPlZLpscyg70q01nkxpb1tvHkzWT6oHHulqpR4piyQl7k5ozZjmlTVnQi3YzQDTWlX4D gapuy620AlbKu/CiLenReoAbgJWp0ajUJe9UiilTehgHkBOfIPs+Wnp0whhnr2Ra2wyGib qtL/3ZqQk4ovIwc9Mh5oEtF9EZ+pqCI= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=XgAMbi2x; spf=pass (imf18.hostedemail.com: domain of 3BkLVZgYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3BkLVZgYKCB0LNK7G49HH9E7.5HFEBGNQ-FFDO35D.HK9@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e1ce191f74fso639349276.2 for ; Sun, 01 Sep 2024 21:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1725252102; x=1725856902; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=jIAzqL0tmqWuUadipZSgPIzfdbVk1YeOcL9yjZr6O/Q=; b=XgAMbi2xt/IsxE7wIWaYaZepwMqLLbad+UQAIl8ymmOCzIeo3Oa8+K9ZiMETylLfyy hTq1gBw1S6D3zVnfu3kaJG3/nmKxAJ58g7fv3Ta5TNhJenVs0R0+rs1DVD6z2yIB9M9k SbGp+BJ1reFclNeyHnWGpnELrxVgRMJry2BQmiiYXNmiMivkaL7kypJugJ/BdhyTA/Xo crl0K5n8DkKPdPEAjabwAMbOJTSWGSg6nBhWtCSL708kR4xlTRR7dMoGecY0+cqCqLdO lpeaVjviV89S5fdJpL0NXRCQUC6MFy+usH+3sVDiP9vVS4TUyhULI80MFC8ILOLUJU6B cIsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725252102; x=1725856902; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jIAzqL0tmqWuUadipZSgPIzfdbVk1YeOcL9yjZr6O/Q=; b=dz56Ol/d+G/uCpT9JjEB5lNKRXXY80L3KhPGWxhpAl+vJc55DI9tKSCk0PLODZtBEJ 6y+zDCPxip3ab4IIekxCbsoe2D2DElhMWlZgn6cHWd8nX0qH4Sggs5zuOw+lnWcrAoj6 ZS9hFg4fgpYkAOTYwHSCrzVyGleLGQeWo8O6+2/O0CXWi2Hs3oO+aBY8Etbl7pX9nN8c 2p6q4KgLtW+M3pwNclCkHRki9F73xvxbN+DkogiMZM2DaBC5bgusFySxV0ORLAkQZYH1 gH2im2dXfsZ/M0EL6S3CI8f65z+DTNyIt971BIEhHelCuaMy1jwFoLH2cKZJhjUtdUzX wfHg== X-Forwarded-Encrypted: i=1; AJvYcCUI1+1+TvSRSWhS7RqTEHVIysq1e6IFLorp36Ovywl/pSEFyR5WzyI3I3M7yPVd/ynOjwFrpuD+MQ==@kvack.org X-Gm-Message-State: AOJu0YwwzbHcwCSonVPemOj2T95POyEcZdz4V/WUbUVwsjUE//rJybVW 90QVLfx36Z8Z4oq8blbYT+135Zv+fmWcOBDGA/l+QWF8OysNsNsahaeeTG7JauGHO+wMb2hsckh 4QQ== X-Google-Smtp-Source: AGHT+IGweUdtvzfkyW3WmJuGFzyyd2e8B2d2obHsNq5jvXmRb4BdxuAkJtcuoa6tBEzRO4VbtFxeXiTxIrs= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:7343:ecd2:aed:5b8f]) (user=surenb job=sendgmr) by 2002:a5b:d06:0:b0:e11:6a73:b0d with SMTP id 3f1490d57ef6-e1a7a171852mr16567276.6.1725252102521; Sun, 01 Sep 2024 21:41:42 -0700 (PDT) Date: Sun, 1 Sep 2024 21:41:27 -0700 In-Reply-To: <20240902044128.664075-1-surenb@google.com> Mime-Version: 1.0 References: <20240902044128.664075-1-surenb@google.com> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog Message-ID: <20240902044128.664075-6-surenb@google.com> Subject: [PATCH v2 5/6] alloc_tag: make page allocation tag reference size configurable From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, corbet@lwn.net, arnd@arndb.de, mcgrof@kernel.org, rppt@kernel.org, paulmck@kernel.org, thuth@redhat.com, tglx@linutronix.de, bp@alien8.de, xiongwei.song@windriver.com, ardb@kernel.org, david@redhat.com, vbabka@suse.cz, mhocko@suse.com, hannes@cmpxchg.org, roman.gushchin@linux.dev, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, pasha.tatashin@soleen.com, souravpanda@google.com, keescook@chromium.org, dennis@kernel.org, jhubbard@nvidia.com, yuzhao@google.com, vvvvvv@google.com, rostedt@goodmis.org, iamjoonsoo.kim@lge.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kernel-team@android.com, surenb@google.com X-Stat-Signature: f1451fb9ugptgkqodkz6kdeyz5i9nrky X-Rspamd-Queue-Id: 859E51C000F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1725252103-621083 X-HE-Meta: U2FsdGVkX19EbgTJ894YqLoF3cIBS+NKmY6hDjsDKuHYhSLMX0cG8pCGiE3tmlLXTA/4iy0LpsmHc1AblsqSTBgG73SvX63GTr8veG5N3AMnWl48rAdUO5xuwS7PMw4h5J/ar0MT1KaQKS6MXg+YGcxiHRzORvTl0oHa9vir/mlPzjJjFPapGzdpdaPDhYhWGF678fP/QpkH/CgQJx5iwnicylbptc/uLMT97kliDR9/53sXc9qzqQYiQwQqRVqcGa+kaIElftlf0WeBIXarmdKA2Gh+26vUiwghYfdNixDPubA7rNf64rzG6vpDuxikIY424DxrIUsxNzqeBjppPN2BL67AdZrkWic0cidwLCuzE33bJG/qC2QFG2p84c4CXHfUV0GhXRgJ0Yfcsdtgm5Vxbkyl+pEW9ebUJSWzfvwsE6X4N0ljt+Zrd9G1NWSTEeYsoO5vypQzkZ2AIt3uffRIjaKh8bgEFuw2rCL7blwVy5YYX3KHyK1x/K8WTZeV8slzNBhqfeAbgke7isSaemzGWH6Blr5eU3IxpDid90FHR8yhkmGpujMPZHJ+tdJuhajZ2tWpFiP9imNtbFTD0HT9XTPKt47SBf84u1yWUC6jWBYoahMrxq+ZY+WAbiVueODmsTX8QhYo5smv892SSL8N+hngxLj2BujcCzkbR6gFPa3bxM7kpra3CaT/OBKLKbtT+L0XNCOsjBGzDknJ9w3wDSnhgDFLaKpzK7qoG2/jy7qU48vq8EIvr1stWLLYtzhT0CHAprAd1A53cKgPBtZaNeucGub0auC0YxqudpfEVM9tdeU+x1TZACZ5oQ6jeLpIYJxvpoJJGUJvhVHMhkHXvyrKCDkMiGSb7GQCTGRb2N+ns8Ym4AB7FzRRtrKdD7ZRgInFtNQPTUAoLE6sBJXUg6uVDCBeE+dk/B30ukgJ/gL5LIJNalOl1Aj07wKOhwsqBmCOcHYkJrRK6Jy UYdiGTXN faXHhBcXRPI1qM56CYgHeGkHaL348nCSlZWTNK2YKLrc/uJZDE3eY+pSRTzZH63pDmelqC+SxnalLicVAILLwFFFjZ/g4LWiveJtEekcXulE2wU5LywLuULoIC4CeNZkrGgUQGLoVA7GLWSS/ZhW7FbHPm6/pziGBjNECuCPRU6n/PkwYTEJg7o+Oznpqc+7w5SeIgjx219oMIV5xt4d8JRGWxR7XurEglb/ivV+YbzgsEnGYg5zdtgGt6ci3Ghyb3I47Cd51QAwQf7oLdWIcPa3RMz6Vc7oUlHyBuAdXIgyes1kCFoe5qXMSnfp3/lO+uoy+nJ5uc2d8Sjc649+6DDN7oeo1zi+2RNheEKvW24+oJ5J79tZRpdZBfBrlEJ0FBtFCaPLerLpnjkwQE8FyKYc8Sdwxva5wtM5EppMaEnmNt0tqYQEJATXZUQ3rs9XqV/+YeeLaKbVam9GLSf+isvoUvwT342yRbuPq7J+t9goyk3nzmJ1B3TLwH91X83vnnUgP3L1x2YEhMLCBLE7EBqUWmWv5f4Pgx7xfZwiVLgFopG5zGf7+6QHHUaTLgUD0v7KOZcG19+SncFyvFDRquWfB5g== 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: Introduce CONFIG_PGALLOC_TAG_REF_BITS to control the size of the page allocation tag references. When the size is configured to be less than a direct pointer, the tags are searched using an index stored as the tag reference. Signed-off-by: Suren Baghdasaryan --- include/linux/alloc_tag.h | 10 +++- include/linux/codetag.h | 3 ++ include/linux/pgalloc_tag.h | 99 +++++++++++++++++++++++++++++++++++++ lib/Kconfig.debug | 11 +++++ lib/alloc_tag.c | 51 ++++++++++++++++++- lib/codetag.c | 4 +- mm/mm_init.c | 1 + 7 files changed, 175 insertions(+), 4 deletions(-) diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h index 21e3098220e3..b5cf24517333 100644 --- a/include/linux/alloc_tag.h +++ b/include/linux/alloc_tag.h @@ -30,8 +30,16 @@ struct alloc_tag { struct alloc_tag_counters __percpu *counters; } __aligned(8); +struct alloc_tag_kernel_section { + struct alloc_tag *first_tag; + unsigned long count; +}; + struct alloc_tag_module_section { - unsigned long start_addr; + union { + unsigned long start_addr; + struct alloc_tag *first_tag; + }; unsigned long end_addr; /* used size */ unsigned long size; diff --git a/include/linux/codetag.h b/include/linux/codetag.h index fb4e7adfa746..401fc297eeda 100644 --- a/include/linux/codetag.h +++ b/include/linux/codetag.h @@ -13,6 +13,9 @@ struct codetag_module; struct seq_buf; struct module; +#define CODETAG_SECTION_START_PREFIX "__start_" +#define CODETAG_SECTION_STOP_PREFIX "__stop_" + /* * An instance of this structure is created in a special ELF section at every * code location being tagged. At runtime, the special section is treated as diff --git a/include/linux/pgalloc_tag.h b/include/linux/pgalloc_tag.h index c76b629d0206..a7f8f00c118f 100644 --- a/include/linux/pgalloc_tag.h +++ b/include/linux/pgalloc_tag.h @@ -9,7 +9,18 @@ #ifdef CONFIG_MEM_ALLOC_PROFILING +#if !defined(CONFIG_PGALLOC_TAG_REF_BITS) || CONFIG_PGALLOC_TAG_REF_BITS > 32 +#define PGALLOC_TAG_DIRECT_REF typedef union codetag_ref pgalloc_tag_ref; +#else /* !defined(CONFIG_PGALLOC_TAG_REF_BITS) || CONFIG_PGALLOC_TAG_REF_BITS > 32 */ +#if CONFIG_PGALLOC_TAG_REF_BITS > 16 +typedef u32 pgalloc_tag_ref; +#else +typedef u16 pgalloc_tag_ref; +#endif +#endif /* !defined(CONFIG_PGALLOC_TAG_REF_BITS) || CONFIG_PGALLOC_TAG_REF_BITS > 32 */ + +#ifdef PGALLOC_TAG_DIRECT_REF static inline void read_pgref(pgalloc_tag_ref *pgref, union codetag_ref *ref) { @@ -20,6 +31,93 @@ static inline void write_pgref(pgalloc_tag_ref *pgref, union codetag_ref *ref) { pgref->ct = ref->ct; } + +static inline void alloc_tag_sec_init(void) {} + +#else /* PGALLOC_TAG_DIRECT_REF */ + +extern struct alloc_tag_kernel_section kernel_tags; + +#define CODETAG_ID_NULL 0 +#define CODETAG_ID_EMPTY 1 +#define CODETAG_ID_FIRST 2 + +#ifdef CONFIG_MODULES + +extern struct alloc_tag_module_section module_tags; + +static inline struct codetag *get_module_ct(pgalloc_tag_ref pgref) +{ + return &module_tags.first_tag[pgref - kernel_tags.count].ct; +} + +static inline pgalloc_tag_ref get_module_pgref(struct alloc_tag *tag) +{ + return CODETAG_ID_FIRST + kernel_tags.count + (tag - module_tags.first_tag); +} + +#else /* CONFIG_MODULES */ + +static inline struct codetag *get_module_ct(pgalloc_tag_ref pgref) +{ + pr_warn("invalid page tag reference %lu\n", (unsigned long)pgref); + return NULL; +} + +static inline pgalloc_tag_ref get_module_pgref(struct alloc_tag *tag) +{ + pr_warn("invalid page tag 0x%lx\n", (unsigned long)tag); + return CODETAG_ID_NULL; +} + +#endif /* CONFIG_MODULES */ + +static inline void read_pgref(pgalloc_tag_ref *pgref, union codetag_ref *ref) +{ + pgalloc_tag_ref pgref_val = *pgref; + + switch (pgref_val) { + case (CODETAG_ID_NULL): + ref->ct = NULL; + break; + case (CODETAG_ID_EMPTY): + set_codetag_empty(ref); + break; + default: + pgref_val -= CODETAG_ID_FIRST; + ref->ct = pgref_val < kernel_tags.count ? + &kernel_tags.first_tag[pgref_val].ct : + get_module_ct(pgref_val); + break; + } +} + +static inline void write_pgref(pgalloc_tag_ref *pgref, union codetag_ref *ref) +{ + struct alloc_tag *tag; + + if (!ref->ct) { + *pgref = CODETAG_ID_NULL; + return; + } + + if (is_codetag_empty(ref)) { + *pgref = CODETAG_ID_EMPTY; + return; + } + + tag = ct_to_alloc_tag(ref->ct); + if (tag >= kernel_tags.first_tag && tag < kernel_tags.first_tag + kernel_tags.count) { + *pgref = CODETAG_ID_FIRST + (tag - kernel_tags.first_tag); + return; + } + + *pgref = get_module_pgref(tag); +} + +void __init alloc_tag_sec_init(void); + +#endif /* PGALLOC_TAG_DIRECT_REF */ #include extern struct page_ext_operations page_alloc_tagging_ops; @@ -197,6 +295,7 @@ static inline void pgalloc_tag_sub(struct page *page, unsigned int nr) {} static inline void pgalloc_tag_split(struct page *page, unsigned int nr) {} static inline struct alloc_tag *pgalloc_tag_get(struct page *page) { return NULL; } static inline void pgalloc_tag_sub_pages(struct alloc_tag *tag, unsigned int nr) {} +static inline void alloc_tag_sec_init(void) {} #endif /* CONFIG_MEM_ALLOC_PROFILING */ diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index a30c03a66172..253f9c2028da 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1000,6 +1000,17 @@ config MEM_ALLOC_PROFILING_DEBUG Adds warnings with helpful error messages for memory allocation profiling. +config PGALLOC_TAG_REF_BITS + int "Number of bits for page allocation tag reference (10-64)" + range 10 64 + default "64" + depends on MEM_ALLOC_PROFILING + help + Number of bits used to encode a page allocation tag reference. + + Smaller number results in less memory overhead but limits the number of + allocations which can be tagged (including allocations from modules). + source "lib/Kconfig.kasan" source "lib/Kconfig.kfence" source "lib/Kconfig.kmsan" diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index 53bd3236d30b..73791aa55ab6 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -151,6 +152,26 @@ static void __init procfs_init(void) proc_create_seq("allocinfo", 0400, NULL, &allocinfo_seq_op); } +#ifndef PGALLOC_TAG_DIRECT_REF + +#define SECTION_START(NAME) (CODETAG_SECTION_START_PREFIX NAME) +#define SECTION_STOP(NAME) (CODETAG_SECTION_STOP_PREFIX NAME) + +struct alloc_tag_kernel_section kernel_tags = { NULL, 0 }; + +void __init alloc_tag_sec_init(void) +{ + struct alloc_tag *last_codetag; + + kernel_tags.first_tag = (struct alloc_tag *)kallsyms_lookup_name( + SECTION_START(ALLOC_TAG_SECTION_NAME)); + last_codetag = (struct alloc_tag *)kallsyms_lookup_name( + SECTION_STOP(ALLOC_TAG_SECTION_NAME)); + kernel_tags.count = last_codetag - kernel_tags.first_tag; +} + +#endif /* PGALLOC_TAG_DIRECT_REF */ + #ifdef CONFIG_MODULES static struct maple_tree mod_area_mt = MTREE_INIT(mod_area_mt, MT_FLAGS_ALLOC_RANGE); @@ -159,7 +180,16 @@ static struct module unloaded_mod; /* A dummy object used to indicate a module prepended area */ static struct module prepend_mod; -static struct alloc_tag_module_section module_tags; +struct alloc_tag_module_section module_tags; + +#ifndef PGALLOC_TAG_DIRECT_REF +static inline unsigned long alloc_tag_align(unsigned long val) +{ + if (val % sizeof(struct alloc_tag) == 0) + return val; + return ((val / sizeof(struct alloc_tag)) + 1) * sizeof(struct alloc_tag); +} +#endif /* PGALLOC_TAG_DIRECT_REF */ static bool needs_section_mem(struct module *mod, unsigned long size) { @@ -216,6 +246,21 @@ static void *reserve_module_tags(struct module *mod, unsigned long size, if (!align) align = 1; +#ifndef PGALLOC_TAG_DIRECT_REF + /* + * If alloc_tag size is not a multiple of required alignment tag + * indexing does not work. + */ + if (!IS_ALIGNED(sizeof(struct alloc_tag), align)) { + pr_err("%s: alignment %lu is incompatible with allocation tag indexing (CONFIG_PGALLOC_TAG_REF_BITS)", + mod->name, align); + return ERR_PTR(-EINVAL); + } + + /* Ensure prepend consumes multiple of alloc_tag-sized blocks */ + if (prepend) + prepend = alloc_tag_align(prepend); +#endif /* PGALLOC_TAG_DIRECT_REF */ mas_lock(&mas); repeat: /* Try finding exact size and hope the start is aligned */ @@ -373,6 +418,10 @@ static int __init alloc_mod_tags_mem(void) return -ENOMEM; module_tags.end_addr = module_tags.start_addr + module_tags_mem_sz; +#ifndef PGALLOC_TAG_DIRECT_REF + /* Ensure the base is alloc_tag aligned */ + module_tags.start_addr = alloc_tag_align(module_tags.start_addr); +#endif return 0; } diff --git a/lib/codetag.c b/lib/codetag.c index 60463ef4bb85..cb3aa1631417 100644 --- a/lib/codetag.c +++ b/lib/codetag.c @@ -149,8 +149,8 @@ static struct codetag_range get_section_range(struct module *mod, const char *section) { return (struct codetag_range) { - get_symbol(mod, "__start_", section), - get_symbol(mod, "__stop_", section), + get_symbol(mod, CODETAG_SECTION_START_PREFIX, section), + get_symbol(mod, CODETAG_SECTION_STOP_PREFIX, section), }; } diff --git a/mm/mm_init.c b/mm/mm_init.c index 4ba5607aaf19..231a95782455 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2650,6 +2650,7 @@ void __init mm_core_init(void) report_meminit(); kmsan_init_shadow(); stack_depot_early_init(); + alloc_tag_sec_init(); mem_init(); kmem_cache_init(); /*