Message ID | 20231024134637.3120277-23-surenb@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 887C4C00A8F for <linux-mm@archiver.kernel.org>; Tue, 24 Oct 2023 13:47:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA7626B027F; Tue, 24 Oct 2023 09:47:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BDFDB6B0280; Tue, 24 Oct 2023 09:47:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0A116B0281; Tue, 24 Oct 2023 09:47:33 -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 88A116B027F for <linux-mm@kvack.org>; Tue, 24 Oct 2023 09:47:33 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6FE3D160985 for <linux-mm@kvack.org>; Tue, 24 Oct 2023 13:47:33 +0000 (UTC) X-FDA: 81380482386.06.71BCAA4 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf12.hostedemail.com (Postfix) with ESMTP id 95E2C40021 for <linux-mm@kvack.org>; Tue, 24 Oct 2023 13:47:31 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=qBm3infp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of 38so3ZQYKCJcJLI5E27FF7C5.3FDC9ELO-DDBM13B.FI7@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=38so3ZQYKCJcJLI5E27FF7C5.3FDC9ELO-DDBM13B.FI7@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698155251; 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=dyxdpQkY+52gRKectHQ0ToMTqRIUgvQpNStJHRxgij8=; b=bMq57LDwXDTwG4mLtd31bOpXJnn9BzBZ4DNXuf+Zbn+9WjcEIqKbwRM5fFb2MdmywVkg3H xPX6JL4ElEKGOeJ7q1BbWbGlozvEjMTdFAJXae7QRbIDVvOlFhVgXZkxv+3boH3IQN7A7Y ZiCa7y/6WsxKe/Y6DxFKBvluDwycwbI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=qBm3infp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf12.hostedemail.com: domain of 38so3ZQYKCJcJLI5E27FF7C5.3FDC9ELO-DDBM13B.FI7@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=38so3ZQYKCJcJLI5E27FF7C5.3FDC9ELO-DDBM13B.FI7@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698155251; a=rsa-sha256; cv=none; b=H3tfizt4xrHqvoasqeRTq/m5kENWME7eBE2Yd10sr1fe9vyyH7GwIc2eHfKHZzz/6YWoKp WuCrx2iERASyqlgjR+JfabzxEMMo3C6CL6TwKFFuMk2mTfaFTkaFh7EyRX+ixl1O2rKrsE QMfbM75kSGURJ2y7DVO/GKwb0mJc7cw= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-5a90d6ab944so49806777b3.2 for <linux-mm@kvack.org>; Tue, 24 Oct 2023 06:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698155250; x=1698760050; 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=dyxdpQkY+52gRKectHQ0ToMTqRIUgvQpNStJHRxgij8=; b=qBm3infpJJqgBpj8BQDfguNnvSnuUNEnG0oiFtVArAtH1m7b/pRxcWutZFEwmu+wpb KYIwyPZJlFypY3/QFoiyfdKDQXb9pQyzJzC0YsYgXhGxOU/yUywl/zr+M9PUsVbjke7c 9IvKKftOlJIdpo4vsgMkAgtJMPYmnzgC5/wDqNXIhwQ2f/OvrqyOMdZoXhPvA5lt9eiU wg0pWqX5whJlQrDDPtx2CYpyl+YuJbjq2Ol/xV5JfmQtOqHegePSpgZRYixIMSV6hH9J 0JYv79+lpHrkaHpScUZXDhLoKcNcKiYR0kNx5sg2fpLwKlZ7rY/DmXkEX1yr5AnJ0BUf PY0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698155250; x=1698760050; 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=dyxdpQkY+52gRKectHQ0ToMTqRIUgvQpNStJHRxgij8=; b=aNPDR2Zu5ScZUx6Fqj34cZzQN42BiUkvTRhFWm76EiXEwdLmOIxil/Vo6HZEC4nnEJ dHzYcAq8MDxMUjtg2ycmqUFo1Eu4HEsEXwR1wBRr1WUWPFqZniZb2SfSAqQlXYiVKNAm Pp0eif2GFMxaE1D/djjc9l4G6hRPsGOuIDhYaKtjRhbpO6K07fjTt0TV0KssTLkMbPXJ QD+9xO5u2a3QVvEGdeatz289uSsLzvDQf6LdyBbyTJTJnhbUj7oiABMv+f9tROVJgEOR +aCkIyG554RA5TjVW0kgU1jB4N2m7moYQa5qOEW8qe1zmbCaUkUdo8H6ajaN1aMCbT7F nQgw== X-Gm-Message-State: AOJu0Yx3r8ucwKA9hn60+PfUQe6aYPtnz+c9JMathEacvjmSZYvO5r2z LVD6lajmqTnmtjwBT4U64Yb37fvLijY= X-Google-Smtp-Source: AGHT+IH6emT7vBUijCZAXTQg5qCnjqbhy63v478Fz+jbhTeMwMkT3/M97iqix7XYtIWpa3tPCFKbfUZWH1c= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:45ba:3318:d7a5:336a]) (user=surenb job=sendgmr) by 2002:a0d:d84a:0:b0:5a8:5653:3323 with SMTP id a71-20020a0dd84a000000b005a856533323mr243310ywe.2.1698155250598; Tue, 24 Oct 2023 06:47:30 -0700 (PDT) Date: Tue, 24 Oct 2023 06:46:19 -0700 In-Reply-To: <20231024134637.3120277-1-surenb@google.com> Mime-Version: 1.0 References: <20231024134637.3120277-1-surenb@google.com> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Message-ID: <20231024134637.3120277-23-surenb@google.com> Subject: [PATCH v2 22/39] lib: add codetag reference into slabobj_ext From: Suren Baghdasaryan <surenb@google.com> To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 95E2C40021 X-Stat-Signature: 1s9fhs3kipimb5ps4pyb1jj8z1iqp9ny X-Rspam-User: X-HE-Tag: 1698155251-380829 X-HE-Meta: U2FsdGVkX193Ku16yUIWd7oUIGF6LOpbKDvMCkXXehYK/TfJRcbK0NxIH1N3rkQylhavP533KlTJSB93ijzV7tNYPzLWAm3YLze6yd074tuixMsdKtdwkXAOCtoOEJySysEJpnElJFiBD6AL7ampcpTdsJJNxzb2M6bmbNu84+u4KoC9CEe2H5/H2lBsGRRZLb7NR7f5qkObDcdfLjBLlIAidO4ZoC46d1mc7wC+bUBT2M3Y1wpKowQbc6WNw3cwKMtTF+ZLqLWcZ3cXEbE7yNDojsSRzLWyguon1YQ7K+r7FSTuVN1eVizLXw7ePb8ib8c6iiQsEdJNcTi0qun/yxRXXis8mPnzfvUsyfH+3Si6UdO60EhN9/4xL15MCUH8135RdCCe0Bq7d3e1wujkjLMthi9flrVZ8ZONGHyog+p7zaFCqlQiU7j/y//j80SvdRND+3kpQtw8HDg1m1tp3A+EekYccYBhgEgbl3N9czO1icNbQubEZvF5qGuj1XGcEGT7cZXKo2yz3YFSP1T3pQdgPsdbR1l80Y3wFuPx6iIAhYbV7gtOfVqs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EfizVMSSgsDPqYKKS5wXqjQPLLsEsH+lrkBr7gzXgDL3M7IJbI6Nn4UG6kG2mG/3bu393nRYF+7o0FcnXE/Y 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Memory allocation profiling
|
expand
|
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index f3ede28b6fa6..853a24b5f713 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1613,7 +1613,12 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, * if MEMCG_DATA_OBJEXTS is set. */ struct slabobj_ext { +#ifdef CONFIG_MEMCG_KMEM struct obj_cgroup *objcg; +#endif +#ifdef CONFIG_MEM_ALLOC_PROFILING + union codetag_ref ref; +#endif } __aligned(8); static inline void __inc_lruvec_kmem_state(void *p, enum node_stat_item idx) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e1eda1450d68..482a6aae7664 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -973,6 +973,7 @@ config MEM_ALLOC_PROFILING depends on !DEBUG_FORCE_WEAK_PER_CPU select CODE_TAGGING select PAGE_EXTENSION + select SLAB_OBJ_EXT help Track allocation source code and record total allocation size initiated at that code location. The mechanism can be used to track diff --git a/mm/slab.h b/mm/slab.h index 60417fd262ea..293210ed10a9 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -457,6 +457,10 @@ int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s, static inline bool need_slab_obj_ext(void) { +#ifdef CONFIG_MEM_ALLOC_PROFILING + if (mem_alloc_profiling_enabled()) + return true; +#endif /* * CONFIG_MEMCG_KMEM creates vector of obj_cgroup objects conditionally * inside memcg_slab_post_alloc_hook. No other users for now.