From patchwork Mon May 1 16:54:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13227645 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 90A37C77B73 for ; Mon, 1 May 2023 16:55:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3327A90000C; Mon, 1 May 2023 12:55:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BD97900002; Mon, 1 May 2023 12:55:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C00690000C; Mon, 1 May 2023 12:55:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EC04B900002 for ; Mon, 1 May 2023 12:55:31 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C51BC407F9 for ; Mon, 1 May 2023 16:55:31 +0000 (UTC) X-FDA: 80742287262.26.2FE6491 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by imf28.hostedemail.com (Postfix) with ESMTP id E3311C001C for ; Mon, 1 May 2023 16:55:29 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=j+Kr4wFQ; spf=pass (imf28.hostedemail.com: domain of 3AO9PZAYKCEc130nwkpxxpun.lxvurw36-vvt4jlt.x0p@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3AO9PZAYKCEc130nwkpxxpun.lxvurw36-vvt4jlt.x0p@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=1682960130; 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=DK6/s7foZNj5EExVH4gZckioJVPcIxI52cq1C7FfTD8=; b=XaNjW2x0Aua7BEQWkps2d5wSc/RXm+n8rGJ/EMzL9rvT/1ZuwcytEsksibQi+MVyd2QS47 s22hfbSzxi3F7Jebtk3M4aqpjCeXeJV0THqs+WpbAl+gK+tprYwQc9o53wy+Y94VOjvkx/ v690mky3ivTzEm+NqVMqBCCHDMTl7eA= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=j+Kr4wFQ; spf=pass (imf28.hostedemail.com: domain of 3AO9PZAYKCEc130nwkpxxpun.lxvurw36-vvt4jlt.x0p@flex--surenb.bounces.google.com designates 209.85.214.201 as permitted sender) smtp.mailfrom=3AO9PZAYKCEc130nwkpxxpun.lxvurw36-vvt4jlt.x0p@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682960130; a=rsa-sha256; cv=none; b=hFUU7Y1LUD/rwVCYUYmOCHtZtXWXoJ3ORbiWEnAOpSLuz7wXHy7/By5c3W87q6wX8kGxiq 018TWxa9mAvuDQco/Adh1lUVNFS9g4fFf64+fD6+5/t3mSOtXOPnqIRQQepVHjdhAu7lm6 71sA87xC+wStCfu64qnV3KFO2TzXVtA= Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-1aafc4aa1c6so5947355ad.1 for ; Mon, 01 May 2023 09:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682960129; x=1685552129; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DK6/s7foZNj5EExVH4gZckioJVPcIxI52cq1C7FfTD8=; b=j+Kr4wFQ8hb6ghgASWLoQmwshyZipq1bE+D/CA603zsc4kB1n7R3CTQw1X9N4pK0pE 0zmuTlr7BciP0EtB463YkQ7YcnZO9MQaA53eLGwRosKH+IiuL9AF+xukRwd1DIpRoQoE CuOOiRq7K1VtqSyYvIO65JDUgFMtQPFNC1XFk5UKDZu8zG86BBXEpcIuAsalgfYjpqSk 4H7kaQB7eIw3KHROJbChdasmtpmhAOtDolQRdOsPV+jVQQISfSODNw3+xILO7OLY0pMp pmy+NWFCOxFQwMauo6Mv0q9Qa8hd2IlOPM48vsABoana6/QPtONXZz6Lhi9KWaOg0TwZ kOfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682960129; x=1685552129; 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=DK6/s7foZNj5EExVH4gZckioJVPcIxI52cq1C7FfTD8=; b=fYLg1SKF58o8HWyEu8oECha9qSEQGcDTdVBBMoFG9j//R8gIkOmxSoPdtO3tHsl9U1 FwQNx89DtYSdlKwBBhXIDWNHbyHJdDRB+AGx+IlaW5+D3ibtmvWTBzSPYcVSCbRYc45Q IsyKSULm2JR7tfdunzTpOJRswFsOCkLnwN9tTqGB5i0GoHxWUOgJ1bEZOrjMRO3ai1Ts YvBtE5omA2uJQwtcX4MUMNEcPxuS+oKDcnNQ0OdQ0WaMPwuPaW0nOC3ivh2QASMMF3p2 qa3yMtInCToh0kgxbgjelfxnH1JS0B3/2fJBpjWa2VrQQejuYjo5hn1BuLXENcKSavs6 3gBg== X-Gm-Message-State: AC+VfDxDGvNRYmGI36vqkPicxFlL7TvCFPIhCs0zhisRCt0QEE9r9871 Ci5tOQNlzyLs6KL91nfqLSbbVDZ+uBQ= X-Google-Smtp-Source: ACHHUZ501oAX8t/t8FRpUPo9PQ1t5ZgNv7pUhAgWb4tueLlYCBA4gtRhgJc8gsKy6W9D1EibQZVYd1jDC2Q= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:6d24:3efd:facc:7ac4]) (user=surenb job=sendgmr) by 2002:a17:902:6a84:b0:1a6:4543:d295 with SMTP id n4-20020a1709026a8400b001a64543d295mr4657171plk.5.1682960128744; Mon, 01 May 2023 09:55:28 -0700 (PDT) Date: Mon, 1 May 2023 09:54:19 -0700 In-Reply-To: <20230501165450.15352-1-surenb@google.com> Mime-Version: 1.0 References: <20230501165450.15352-1-surenb@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230501165450.15352-10-surenb@google.com> Subject: [PATCH 09/40] mm: introduce __GFP_NO_OBJ_EXT flag to selectively prevent slabobj_ext creation 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, 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, 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 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E3311C001C X-Rspam-User: X-Stat-Signature: xy54efsggm9tpid78p9fa46spgnmmc9s X-HE-Tag: 1682960129-441444 X-HE-Meta: U2FsdGVkX1/dMwVmdzzU2IQVEHIMCsStnKw5+eQBB0P503ZAZCJ4eHnq5gky3UqkTXLCPxmX96GI52jDqhBxnK4OvGy1rwmEI3QIN6Hs343ctKaJ3NmMkEwEAVspKuP7OjwT7xj1nptvqasXfvdM+Z4FqUNEyermWNCaLkTRZwP6JZzV2DirBW5nHCM666hmYXRWIDGjgxxCY9rwNQF5ppPP+nMavrKGDJCLVFaRhYXqjhFXC4BUUiMrlbmEAHke0r5AJmH/KDIS1txL8z6TVbQQjPmzyYt3MQ63YkyuhIbROEjPAHQ9Go+IgX5WKuyh/eG31aWLmwGCHXij9niUHnRoEaiFlrBeY05LxOexQS1Gv5/0RzO9M4j1cAo7LSo+28Mpc92iv214MUnrjUqAInAIyvt3WZmnkCPM6ShfHYQOTYJQ8w/l1i8bUULCTQ5ZX+Qgtkscf6IAAueyMeL/nNCL0DFPLw5p0oKJmnaSPMJs+pTGDoduojpL3LJGf+bWrTim24uePAEwt9L6cQ9BaRKewWmPCdeCDCy9fgowFzTu8Vaajjo11WTMY23zVrKb2z+n1HERMgq7jEl4TZEy2sASsMbl/35wY8G8r03k/Vn8SOF8YEk8WBxMjjA+bAW6LHnbkE0xzlmBASp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JsI 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: Introduce __GFP_NO_OBJ_EXT flag in order to prevent recursive allocations when allocating slabobj_ext on a slab. Signed-off-by: Suren Baghdasaryan --- include/linux/gfp_types.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/gfp_types.h b/include/linux/gfp_types.h index 6583a58670c5..aab1959130f9 100644 --- a/include/linux/gfp_types.h +++ b/include/linux/gfp_types.h @@ -53,8 +53,13 @@ typedef unsigned int __bitwise gfp_t; #define ___GFP_SKIP_ZERO 0 #define ___GFP_SKIP_KASAN 0 #endif +#ifdef CONFIG_SLAB_OBJ_EXT +#define ___GFP_NO_OBJ_EXT 0x4000000u +#else +#define ___GFP_NO_OBJ_EXT 0 +#endif #ifdef CONFIG_LOCKDEP -#define ___GFP_NOLOCKDEP 0x4000000u +#define ___GFP_NOLOCKDEP 0x8000000u #else #define ___GFP_NOLOCKDEP 0 #endif @@ -99,12 +104,15 @@ typedef unsigned int __bitwise gfp_t; * 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 @@ -249,7 +257,7 @@ typedef unsigned int __bitwise gfp_t; #define __GFP_NOLOCKDEP ((__force gfp_t)___GFP_NOLOCKDEP) /* Room for N __GFP_FOO bits */ -#define __GFP_BITS_SHIFT (26 + IS_ENABLED(CONFIG_LOCKDEP)) +#define __GFP_BITS_SHIFT (27 + IS_ENABLED(CONFIG_LOCKDEP)) #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) /**