Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2580718rdb; Wed, 21 Feb 2024 12:08:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUbViynL/BsRy+JfauTWEem8d+FisZaMxc1TtyfsT+misId0D48HB/azdZtO0RNV65urJnVlMxGZYuyzVHNWj5LiLHbTl3ZD0po3T2Cyw== X-Google-Smtp-Source: AGHT+IGnpvY9cRp8Vveq18sxUAxGGa9TSG6rXvy/Invq+VtphC6wFPb71NapSt7uF4Szo8g4zoRW X-Received: by 2002:a05:6358:5f0c:b0:17b:581c:430e with SMTP id y12-20020a0563585f0c00b0017b581c430emr3612285rwn.3.1708546133404; Wed, 21 Feb 2024 12:08:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708546133; cv=pass; d=google.com; s=arc-20160816; b=gDa+kAsAdaYYkVbozohiEUvBze49b285u9YeNvfbWwAWoDSPbaIYLSi94ixyPo6Pw1 HxqmQGLIAvRtLck+eschwMOOjGoCiJl6kaKKUTegZYOwz23wPzR/5/6WADAZZds4xYjr t0q1LsEH7GveTRDzjfJWlqyAmOjbmBdxnnsKyhRFS3GM2u4HhTzxLZf1Y5SlXbdCFl9M Ql7AK+oZYXALeFYaB1JbzbinmtCRxW5f8rYvCOU6KDSt4/wcwogyiIGC+BoTyrSbS9Aa /6DmxqHbr98eWRzqWFUhm2pVt0+2aMOUAO7Q6t3bGcAQfDCG1T9YZ123DRCTSwtuMx7Y v7Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=4D2ym4tmaIuNf1w08quK73QR9EK/cyrgSXHS1sTLYhg=; fh=1cmPSIgAG/tAPMxbEYzoHmqkj8SMdeUIxYf3uD+6hmI=; b=f75VKOT4X36kkPwfRirQZYt108oSWGXwqjm5VWsbmaaPcFQAmGw8BDOsq/F2pgk+bX 4rI7WodcprOJO2ZX0z0OVirm5ROXch2iMK25zYzeSZwQhLVv7PXw+43xh+inISbT2P2M E34W/sg3zAs9SpDsnsZCaDRwtPjG1oqEYyK3sdvwJlKcp5BYt19b1m6KNcBxIRAUoc23 akTDIp6M0/+Sfxi2UDcta2j98fXh2twieZHyj6q0o1WeUQBi96Qb8QDKoAC6dlgSRCO+ d/zNqT/T1c5WLg/uyxFjR6XCYKSujV9W1/J+kDcVHVxzGkb5T1iCbKOmeiq2vS5fksXC tHew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GuV3TJ3M; arc=pass (i=1 spf=pass spfdomain=flex--surenb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75400-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75400-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k126-20020a633d84000000b005d79125d04dsi8712837pga.726.2024.02.21.12.08.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:08:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75400-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=GuV3TJ3M; arc=pass (i=1 spf=pass spfdomain=flex--surenb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75400-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75400-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C688CB2968A for ; Wed, 21 Feb 2024 19:50:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4ACB514F9DD; Wed, 21 Feb 2024 19:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GuV3TJ3M" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E671C126F01 for ; Wed, 21 Feb 2024 19:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708544505; cv=none; b=SB5/Bah5VQbtQ0gylpKyieCYY+P6bvVmaQ8uo44MAKF+XwHa10/uTtnsfUClizxjcIk7CVCrE3sXPI3JI6RQUGRW+amD0q9w+K2x+54nN41Ydf3yFgk5gfyvPgpIPN2aWcOXuXjJ0wbYaHbk//qsC9DUDHArBEaAN+RzdT3kf34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708544505; c=relaxed/simple; bh=tyIikjJlrYyNLJoOHRGtPA/wKSTMkEiPDo19C/DYXH4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=vBURD0SWB4FlsH2X4I6tsYiqU/c/Oc8Cu21+okoPUr/ZrBDTpI6a8RcIfIqwXoZXeli/3xZyZEzUL+cQkXDuiqwwYSU5U+ec9v7ZFFoWMy77fr8kfAf9vRxnfy+Wz53txba3XYuQE/HUsYPLEUp5eAhR3IMzu7Mvka5KgcLwHpE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=GuV3TJ3M; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-608835a1febso18654357b3.2 for ; Wed, 21 Feb 2024 11:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708544503; x=1709149303; darn=vger.kernel.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=4D2ym4tmaIuNf1w08quK73QR9EK/cyrgSXHS1sTLYhg=; b=GuV3TJ3MrI71MbxE34f/5qi8JNdui5fJUINhuMdeX1pUpXOUTj7yHD3Eld8RsYWH8f M/bNF47TLDvzMTaikAwQfx5WddNrQm6sqCLiOiARVX7t+xQ7Eq5H7GY4kcchBe3XFPMM HAVGsc1rrSCkuU8pLk5mAWeFBMxrfkeRSXQp6E908UePDaoCInUbhxotyQX2qhK5w/wI j2SdaGwjQqVMqvULZDe0ZO0V316WYJSGZI/mCCndvhtjVEoU8Bja0evFw0h1iM6XbYBG qlc3/mtkzf3fQG2/AG70AhJGtroFax1I18GSPlZL8f4nBZRtDCg0p0AiAVunFN34nnap p/4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708544503; x=1709149303; 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=4D2ym4tmaIuNf1w08quK73QR9EK/cyrgSXHS1sTLYhg=; b=VkvNNn0DSUPM3flj+iBuQA8w25mXWgbWJmI/6tppdTIOb5GrEGMZfqQ8Kz2uQmx4Xt 8FP0ycUXDqhCXmjNK2cEbG5FiX70uw2eeji1GwMbH8qp8zcYRe9CtXbmMqAwShlPyNsp PCJ1jtRaXQj8jcnczGX0SeyBWMrikJi6o6fvcWrGVH/xlgyWK9aw/tCQ6EVIVVh6F47X WeTOlA1zQfAFpPymxltDu7kpofdal0tphZIShCFQbX+quzNhdCoQEIVbICB25g4aMXEH LjET4BPE85twssBCSNXQaq2mG10KdP8rRTpg0HovLY7vjV6FDR90AEPzJmhJcRStwTi9 yamA== X-Forwarded-Encrypted: i=1; AJvYcCUZwi/LZDWZWmwL+gDzEHIou4kTd2HDTopvRdhzTq0tV80rCsIOFqYspYgHR/sCDYRkQn/R+xxhL1DSVHPsF5/az0/fp9bJseHZJzs2 X-Gm-Message-State: AOJu0Yx9cd5bSGHUbCv/5JoNCA6ZYl4siWux4cCrvtnIqWR3V22zGHhI AX7WhG8FNgu/FH3B3Pb3A0KDzcyjlH/W1uBS3ry/smftvfPwL34rRxW5HP8ruDdYWUdW7wbH9S3 kRw== X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:953b:9a4e:1e10:3f07]) (user=surenb job=sendgmr) by 2002:a0d:e611:0:b0:607:9268:6665 with SMTP id p17-20020a0de611000000b0060792686665mr4677003ywe.10.1708544502298; Wed, 21 Feb 2024 11:41:42 -0800 (PST) Date: Wed, 21 Feb 2024 11:40:34 -0800 In-Reply-To: <20240221194052.927623-1-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240221194052.927623-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog Message-ID: <20240221194052.927623-22-surenb@google.com> Subject: [PATCH v4 21/36] lib: add codetag reference into slabobj_ext From: Suren Baghdasaryan 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, penguin-kernel@i-love.sakura.ne.jp, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.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" To store code tag for every slab object, a codetag reference is embedded into slabobj_ext when CONFIG_MEM_ALLOC_PROFILING=y. Signed-off-by: Suren Baghdasaryan Co-developed-by: Kent Overstreet Signed-off-by: Kent Overstreet --- include/linux/memcontrol.h | 5 +++++ lib/Kconfig.debug | 1 + 2 files changed, 6 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index f3584e98b640..2b010316016c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1653,7 +1653,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 7bbdb0ddb011..9ecfcdb54417 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -979,6 +979,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 -- 2.44.0.rc0.258.g7320e95886-goog