Message ID | 20240321163705.3067592-8-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 963F9C54E58 for <linux-mm@archiver.kernel.org>; Thu, 21 Mar 2024 16:37:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9905B6B009B; Thu, 21 Mar 2024 12:37:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 919766B009C; Thu, 21 Mar 2024 12:37:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D0B86B009D; Thu, 21 Mar 2024 12:37:28 -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 4B9ED6B009B for <linux-mm@kvack.org>; Thu, 21 Mar 2024 12:37:28 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2D9AB160C19 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 16:37:28 +0000 (UTC) X-FDA: 81921601776.20.2800DEC Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf06.hostedemail.com (Postfix) with ESMTP id 5E8C3180028 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 16:37:26 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=h1exedKV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3RWL8ZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3RWL8ZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711039046; 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=WOYiJPoOo6EZ1v2aVMfBUZhNa7dlHF73f/fDRlekI3w=; b=KDSfEkeFjU5mq3gf0JHDHYZ+8NqBi8l4+XoJXUkn6teIK7/fa+YoQPkW9FYH8CTnUSZz7+ Cv2K7GTJk90z0m9Xyy+ZLyfotkKDnzSQTX2QW0vAyi95JpHeDHGyz2cwaUHtH8Gd3dOS59 4AsPvpTr1jpgGH/RzamArQHbYf6zXhs= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=h1exedKV; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of 3RWL8ZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3RWL8ZQYKCDIgifSbPUccUZS.QcaZWbil-aaYjOQY.cfU@flex--surenb.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711039046; a=rsa-sha256; cv=none; b=M0uDHbdcExjkPTA1PGkHErIRISQEOXeY8Tbt0S28oI0/D7zmE7vwrXrNBO+9ZVdRiRFdeo SKf5UdB8s7vXuLLMHgrkPIo4z6G9xU46yD6ZiU3sdgr9hQRKbsk5UqgT7gm10QgzZKc5cd ECmKghQFhwLjlE9XiZ8npS420RXkJ6A= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-60a55cd262aso20235177b3.2 for <linux-mm@kvack.org>; Thu, 21 Mar 2024 09:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711039045; x=1711643845; 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=WOYiJPoOo6EZ1v2aVMfBUZhNa7dlHF73f/fDRlekI3w=; b=h1exedKV8O/r8toA1fNyRIcJnSIRcjVZLvboCDD7Am9b8RCRsoMOe1gHNQuIFtpVmo 6DdHJvgmGcLT2fCJ/6KW1vSJKca2ia0kzDJcNBAB5enNZapNgyp7RF27dsGIpUiQOQJC dko97ycVh6IEOQLIfUhgt3djTmtIysBCCB1JfdPZpwChzdBv8bJJyfJICcRh9QbNBs2v VeEy9l45SaeINwwblbJm74zBsBT+3cUyrE03f6/zAtrLi25n/yXAjCBG1tqWluvbeX78 OVOF0ql7yr2wJyzGRaQpJp5LvX8Uo4MwAADXNw5J4PHbqvTPfGMM2HQi2t+K0TmKywzX qULA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711039045; x=1711643845; 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=WOYiJPoOo6EZ1v2aVMfBUZhNa7dlHF73f/fDRlekI3w=; b=VM+38m50HxBkOoBp5X313ZfLWTYdxSTxfiZ+g7ZzVQoaJDb+u4QN/Wi2Eq+TOzB6tx N0u2Mz0Ccuz2uiymu7vogCEMzrCicND9xcnsR8TM+zRDn6Fzbfn2f/MTg/1/ZuSWN1MM 3V2Gsfjz+IG4xdbKQQifGoai4lMFpS10IrzIsRFVX223zpSreQzYR6KPGwTSLJD4x20j BDogjqpO/OMmID4uAO744iy1nl786AtwDrd7G2NXX6BNOj1nARpE+XNRcyKTmBNIQh7q C/T8v3q7ZpSvkCAIL4gzLN1DX+mnyQ0r+88kVVhjUrC2yGLpcHK09sa9hueGNziNVuXW 2dSg== X-Forwarded-Encrypted: i=1; AJvYcCVOlT+cInpNo1jjBbb27bHFA+eB4QX2GQErERmPsB0zrgBd1zN8AFWOmC+4aiHWeqe9kpQcq8rYleQOU+Fq3ewehH4= X-Gm-Message-State: AOJu0YxygHpxCrc+LNuDro/KkxS8w/YoXweguM8q7MoFgohuVWehW+dn T3wJrJXJZNwtsOscavjvqgya60BcqF1Ley69EEl0BF6FBPuC0SkSqnJ+vD5ETZbZqLgsUZnMYfu sEA== X-Google-Smtp-Source: AGHT+IEAhjSJyNICBFt8fC07FMUXAIv3JTrEOHUKD0VuV0TBcrEbM/VY7SJ2rrR05OxGMObTDGwgaQeFx3s= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:a489:6433:be5d:e639]) (user=surenb job=sendgmr) by 2002:a05:6902:72f:b0:dc6:eea0:1578 with SMTP id l15-20020a056902072f00b00dc6eea01578mr2412289ybt.13.1711039045315; Thu, 21 Mar 2024 09:37:25 -0700 (PDT) Date: Thu, 21 Mar 2024 09:36:29 -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-8-surenb@google.com> Subject: [PATCH v6 07/37] mm: introduce __GFP_NO_OBJ_EXT flag to selectively prevent slabobj_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-Server: rspam09 X-Rspamd-Queue-Id: 5E8C3180028 X-Stat-Signature: bix4nfb544ymftyjz3c7ec7z1z34py76 X-Rspam-User: X-HE-Tag: 1711039046-841309 X-HE-Meta: U2FsdGVkX19LDZE7jKMMzKdXE+HmFtkH4JyFjA/KY0OYtOkOwapL8pXsQSn1SAmrMXchPVX0RXUydjBMUt0lSPrbIYnOFzb0X9PbpZ02NrJBd2y+sGCF2Y1CxErYkpWMiWx/JaNsP0+aLGSk55PaEE0i47xTKJ7+01CNOOe3Ef0FL+KMuZhPA3qtJnbPKku6qixuFDm5aCoWGcNlCQHW28Z7b4cEcdxI3/Ah/tFqNkFzoh/U/PHbVmCgVEU4mgRJ8yRCnhI7vyTh8fiLT+e0jjBKfPmELOx0P5WcjuxslT2cgsCh3FCOa+ZjcQiCh2VWjf5CNGFa1jxPjm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11YY/X+JS74XFVAacJE0A9MiRuWg6g/CC1h8z4b0aM7JDY1lJp74Ng5sHqA6ppaAetx7n3rofFOUlI2K/0vmYVMwCeW8eOhaCBMXz3ySxoryYTB9DTVSYRorY4bH9qzcvWiD7Vg/0NbFJcmzX2RU0m7O7i/4TyocxZPJho5RTiRO0twhY+aow6sMRvrGacajY0PtCsNeqEpgl+Z3rd0Wi43ewClHvZ6m+HHul6Lq+7vH+kWEfVoAJCrCg1ZuQw1AJL4TSBOrrS3xnT2w6+aEqAGfO0x3XYiZxETMxxce/CcrnabXi5/EaqIAAhrH3pts7eTSoTRiNfjmAfSY0Ta1EoFkidDWvyT+zsggmXMA0x1Jjr29xEyboBtZ96Q3IfEY3hfHBujnGZFCFCippooWXDxNMyFo6DEylWkf5sLLBxg5jiAPLLqMVUse7GeblryA== 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/gfp_types.h b/include/linux/gfp_types.h index 868c8fb1bbc1..e36e168d8cfd 100644 --- a/include/linux/gfp_types.h +++ b/include/linux/gfp_types.h @@ -52,6 +52,9 @@ enum { #endif #ifdef CONFIG_LOCKDEP ___GFP_NOLOCKDEP_BIT, +#endif +#ifdef CONFIG_SLAB_OBJ_EXT + ___GFP_NO_OBJ_EXT_BIT, #endif ___GFP_LAST_BIT }; @@ -93,6 +96,11 @@ enum { #else #define ___GFP_NOLOCKDEP 0 #endif +#ifdef CONFIG_SLAB_OBJ_EXT +#define ___GFP_NO_OBJ_EXT BIT(___GFP_NO_OBJ_EXT_BIT) +#else +#define ___GFP_NO_OBJ_EXT 0 +#endif /* * Physical address zone modifiers (see linux/mmzone.h - low four bits) @@ -133,12 +141,15 @@ enum { * node with no fallbacks or placement policy enforcements. * * %__GFP_ACCOUNT causes the allocation to be accounted to kmemcg. + * + * %__GFP_NO_OBJ_EXT causes slab allocation to have no object extension. */ #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) #define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) #define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) #define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE) #define __GFP_ACCOUNT ((__force gfp_t)___GFP_ACCOUNT) +#define __GFP_NO_OBJ_EXT ((__force gfp_t)___GFP_NO_OBJ_EXT) /** * DOC: Watermark modifiers diff --git a/mm/slub.c b/mm/slub.c index 5c896c76812d..2cb53642a091 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1889,6 +1889,8 @@ static int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s, void *vec; gfp &= ~OBJCGS_CLEAR_MASK; + /* Prevent recursive extension vector allocation */ + gfp |= __GFP_NO_OBJ_EXT; vec = kcalloc_node(objects, sizeof(struct slabobj_ext), gfp, slab_nid(slab)); if (!vec)