Message ID | 20240321163705.3067592-9-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 8B201C54E58 for <linux-mm@archiver.kernel.org>; Thu, 21 Mar 2024 16:37:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF1976B009C; Thu, 21 Mar 2024 12:37:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A7DD26B009E; Thu, 21 Mar 2024 12:37:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87D256B009F; Thu, 21 Mar 2024 12:37:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6C56B6B009C for <linux-mm@kvack.org>; Thu, 21 Mar 2024 12:37:30 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 022D51603E7 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 16:37:29 +0000 (UTC) X-FDA: 81921601860.01.E515B89 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf01.hostedemail.com (Postfix) with ESMTP id 3548640005 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 16:37:28 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=gTp2kMv5; spf=pass (imf01.hostedemail.com: domain of 3R2L8ZQYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3R2L8ZQYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@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=1711039048; 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=SHSiwfbVG9SSjDRWdVOT6ZUhatpmkb8bIc+SfDPMGsQ=; b=QAkZpMr5nUqvirBrrL8zLBg0zNqLOVXIxC/XJ8ju3lvOPpJQCenZqP7yXbFQn0R6zKSRJE +/WH1F+md6AVAlaxqhfrJxWMQa38wy5Nd8X+Gxyr18V9nIpya/eiTlMQVQbq/hP8Wft+Or Oj2oUpuG2ME8B/HUWAEkmM0XPXZoVYg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=gTp2kMv5; spf=pass (imf01.hostedemail.com: domain of 3R2L8ZQYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3R2L8ZQYKCDQikhUdRWeeWbU.SecbYdkn-ccalQSa.ehW@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711039048; a=rsa-sha256; cv=none; b=KH/RsTv746/kG9ZWw+HyUI9lT1jJLOXj7yCBYatYuKyo3TiMB4RiWPm65xilixIiZhQrQz qPVR43b8NzWJ6pdbyu51oEBM71vfaty1KUxjr4BBi/LOOEzt4n3CYelHJoA3h6BNQGqpBc lirGEi6pbb4UE1nUBKsXu8bXxdRJK9A= Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60cd041665bso21140057b3.0 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 09:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711039047; x=1711643847; 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=SHSiwfbVG9SSjDRWdVOT6ZUhatpmkb8bIc+SfDPMGsQ=; b=gTp2kMv5/jsBRH54io4pMirGjgoI6BUTUOPj6HxuRmbJGSBVQD7+u7bbsHMQ+GtkmU rKHs5OiAHoRfa8wO1KK6YsAnIfNplx4hGyQ7VFwwGy1d0zh7fmyGl2VVICYMrF+IpChh yVeF7wrR4mfmMBGHWNOVfMzATsfA/YbsoCR+PI5ioxmSf2hKcbU+ROCvA0IoAmFiD54j Kb3IeSmbakBtWWdQc8zOEDgV/8GHu/IP0kiudH0bHEeT8Bm1bUwncvrud0sWD19XlGxt hIRravbGp9ktUBUfXvP5W91j2Wx8hWrkL8ESaulbZwn7Gm2iYyGtsRUGpqXmUHUTaO74 BzNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711039047; x=1711643847; 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=SHSiwfbVG9SSjDRWdVOT6ZUhatpmkb8bIc+SfDPMGsQ=; b=nhc7CUjDDedQy381UAXAWU9Ihs/LCoeP8J+fmHwWm7WUrpnFTVu1ho1iuYK6imfOEv xzrgZLPwG6NwZTpY4hI3tVBhA41me9zojhu1cOxUFRS58YDqf2DvGHvCerqsvG4h6Lyk T9jjF8conLNRgUpUPhoZrW/ImEd8kbWUXqqR7CFndDmx1+S9IfIIyzMsVwbwy8M0Jixb wVk7hsxuYfjj/oexSZQQiidNCDLhiR3n/Y7WdEnrKLnzMPUZqzoteQXQu8oaTMXE3j5x y7olaS8fBTagirCNQj0nLVtP6nWWrOjfhEXoyvCVCkfPCW5OAqV957WlIPLGS6edYomB Y86A== X-Forwarded-Encrypted: i=1; AJvYcCUfrlabGE+G/sMvv7KWDT942oxXbwHWSSRxOa5HuhbZQUd/rwBx2hoWVkJIJpUa9YEX5lI0yzvbBH8F1l50H2pSY8w= X-Gm-Message-State: AOJu0YwIlXC3L/RtoaZxRmd7BvBN3l/5Iask3mZAUDv2zApRPnukfzH9 EKWVc1kXQ66lxt7yhC5Y/+OWu90HYB8f16ZV/QO3JDxL/EMlqAuSimvIU7W7tOvjm/yeyMLpYd4 Lnw== X-Google-Smtp-Source: AGHT+IHTxPHB7kx8Th/drFBQT8IBucAuzxxJkHgWcz7qLRX4uELPgEbRqEPHfHLIjKXlEPHR4aaEf+Jx60k= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:a489:6433:be5d:e639]) (user=surenb job=sendgmr) by 2002:a05:690c:d0b:b0:610:e0de:1387 with SMTP id cn11-20020a05690c0d0b00b00610e0de1387mr2235869ywb.2.1711039047349; Thu, 21 Mar 2024 09:37:27 -0700 (PDT) Date: Thu, 21 Mar 2024 09:36:30 -0700 In-Reply-To: <20240321163705.3067592-1-surenb@google.com> Mime-Version: 1.0 References: <20240321163705.3067592-1-surenb@google.com> X-Mailer: git-send-email 2.44.0.291.gc1ea87d7ee-goog Message-ID: <20240321163705.3067592-9-surenb@google.com> Subject: [PATCH v6 08/37] mm/slab: introduce SLAB_NO_OBJ_EXT to avoid obj_ext creation 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, 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, jhubbard@nvidia.com, 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, songmuchun@bytedance.com, jbaron@akamai.com, aliceryhl@google.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-Queue-Id: 3548640005 X-Rspam-User: X-Stat-Signature: ifgswtswyu6sb3nunbqp7emd4thhcruz X-Rspamd-Server: rspam01 X-HE-Tag: 1711039048-487044 X-HE-Meta: U2FsdGVkX18Qn78Gth8Elj0zaGNCDNpKN3uH6NGz2aEv6IRTF9dmAeU71c1hcfnFMZ8g/js007ZvSvM4Q2n/1poI09sSPD7jwgEzH0ON0wQ1RcpivRPVFS2xVFpMb48S97qUyMvbv0hslCajJRdEhznZbQU34/CiDCqT5FXPw4Rxm4SwZl6pvMnJPO7CbnM6OWq5TbBmuqJsjcKoMJHllYxNs8t6V9QVndsuGkMWcGyPFcCLWmUrbMKo8CGKEessshtHLoEaIKAtGJ7uzuNP7WWsUUsE990Z0RXRMFnbOQqU0gjacIxSbi5Yk5QS76tPBqpV28AgSopyhopnZr9W+eK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O7324xRkrEdmRVgzyNy06KhzYqcm58xner6g9ik9A8p2TXe+Ae4v33riMo8oR0cBatGSPoa6DObEW9n2bz4U5OQ6OcEofFXV+5yXoZnySfnGG1KyonTK7Auyp/JIxATj8rQuA0FHetW8zTe2JsI5pZfBxuWkN6q6ilTtlnFxfVJjvOdmytZgBwIRM9T1b91PcYGHzOhGawWWzdxA2zm3BI5pg4EYwGo1b1PJc7j9VqNnwDedTrN0Xn4GZE05gju8ZXxy18d1sVhxm3MywJ8SkVJJROzizD4pqvey1GqY4KG6VSd0Ptdimlm10kCNecLE/9Ay1+XsAxS7/kzOWKJaAjrmgjHXVLDuVUo5KYP5AaiOKULq2AtklElFlD9ixQBAIMXH1k8SaPx2NMg8+RidRU5x+DLP+P/3peo/CIqOf+kyws80R7/A== 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/slab.h b/include/linux/slab.h index e53cbfa18325..68ff754b85a4 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -56,6 +56,9 @@ enum _slab_flag_bits { #endif _SLAB_OBJECT_POISON, _SLAB_CMPXCHG_DOUBLE, +#ifdef CONFIG_SLAB_OBJ_EXT + _SLAB_NO_OBJ_EXT, +#endif _SLAB_FLAGS_LAST_BIT }; @@ -202,6 +205,13 @@ enum _slab_flag_bits { #endif #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ +/* Slab created using create_boot_cache */ +#ifdef CONFIG_SLAB_OBJ_EXT +#define SLAB_NO_OBJ_EXT __SLAB_FLAG_BIT(_SLAB_NO_OBJ_EXT) +#else +#define SLAB_NO_OBJ_EXT __SLAB_FLAG_UNUSED +#endif + /* * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. * diff --git a/mm/slub.c b/mm/slub.c index 2cb53642a091..666dcc3b8a26 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5693,7 +5693,8 @@ void __init kmem_cache_init(void) node_set(node, slab_nodes); create_boot_cache(kmem_cache_node, "kmem_cache_node", - sizeof(struct kmem_cache_node), SLAB_HWCACHE_ALIGN, 0, 0); + sizeof(struct kmem_cache_node), + SLAB_HWCACHE_ALIGN | SLAB_NO_OBJ_EXT, 0, 0); hotplug_memory_notifier(slab_memory_callback, SLAB_CALLBACK_PRI); @@ -5703,7 +5704,7 @@ void __init kmem_cache_init(void) create_boot_cache(kmem_cache, "kmem_cache", offsetof(struct kmem_cache, node) + nr_node_ids * sizeof(struct kmem_cache_node *), - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN | SLAB_NO_OBJ_EXT, 0, 0); kmem_cache = bootstrap(&boot_kmem_cache); kmem_cache_node = bootstrap(&boot_kmem_cache_node);