From patchwork Tue Oct 24 13:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suren Baghdasaryan X-Patchwork-Id: 13434577 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 F0097C00A8F for ; Tue, 24 Oct 2023 13:47:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 709AA6B0261; Tue, 24 Oct 2023 09:47:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EB806B0266; Tue, 24 Oct 2023 09:47:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 440856B0269; Tue, 24 Oct 2023 09:47:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2C2446B0261 for ; Tue, 24 Oct 2023 09:47:02 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id F1CC9A017F for ; Tue, 24 Oct 2023 13:47:01 +0000 (UTC) X-FDA: 81380481042.20.9E754F8 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf14.hostedemail.com (Postfix) with ESMTP id 42416100030 for ; Tue, 24 Oct 2023 13:47:00 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=E7C6lgL3; spf=pass (imf14.hostedemail.com: domain of 308o3ZQYKCHgoqnajXckkcha.Ykihejqt-iigrWYg.knc@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=308o3ZQYKCHgoqnajXckkcha.Ykihejqt-iigrWYg.knc@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=1698155220; 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=re9qyJoQbXM1lB3hu8WMyX+cG50piCMxG0UfNqXuCfM=; b=J777juFOACs9JrLvbt3Fkv1OU/Er/2hw42IBMe4WyjbMcPbPBujgHTpRJNLHWD+b1kk1S9 /9mVfP8DMACOuLNoXrmC1/O9zBdETFS4EhQbogNdl6DQxqpEof0VK14P9AEegczbUtpUzD 4uKKNqI7/wrQ4Jj3Z6VMoOaB/+yPWwg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698155220; a=rsa-sha256; cv=none; b=oskjztWWQOwQkBTAgR+ccgw8pVwKW2SWtso/HR67g6ywNHo4rlCtocG/CWcmj51tULYTEw Z5F00kVtTY5HUEoa9eeH5dmPqMXqdR6yLZuZyLC3pBGODVZRiTE6jxhJMhcrZJVwv8KQSI dH/aila1R5g47Iw8rAGGXbJa9uvMh3k= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=E7C6lgL3; spf=pass (imf14.hostedemail.com: domain of 308o3ZQYKCHgoqnajXckkcha.Ykihejqt-iigrWYg.knc@flex--surenb.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=308o3ZQYKCHgoqnajXckkcha.Ykihejqt-iigrWYg.knc@flex--surenb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-5a81cd8d267so84822307b3.1 for ; Tue, 24 Oct 2023 06:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698155219; x=1698760019; 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=re9qyJoQbXM1lB3hu8WMyX+cG50piCMxG0UfNqXuCfM=; b=E7C6lgL3/KxPgxT+jT1asvxZ/ITlQPmmvXUo65kNf0RozBsmpg0SVoFEtCK0NUIzuY 775ngCA9/0UPbyPPwZAz1T5911n8Haq4QpfAoRuTxOGr+NzlMlT2yxvthLtZEX6HEj7H swBTg1cyVjnyIRAvvHHF9AwpokyMOTqUNbdmTnPXKpb9vFcas8CK9hRIC2xdYBNwFSKD 236Cxkzb9JOcdpz2JVxR7Pgjp8pYhIwsEZwb1doiUlqDJwMF0jR6Yp73dr8tXWwZ4n/l qm9xEM9/kIE6P2scr9m8botVxJb4SBhMCYp7dpfiemFrFZL/HH42QEswv/GEQEXbC/TV 8SrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698155219; x=1698760019; 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=re9qyJoQbXM1lB3hu8WMyX+cG50piCMxG0UfNqXuCfM=; b=QkxbDq6dFvhx+Io3G4R+f6fWMqKpwLjbgeZO4cYcOxzg9WUDeayKlCtUxsAZmG0Vxy 9S3MjHml8Z9uLPRb9D1ZIX6+3b6PeXWuMWTSawoz3dAN5iy+8nE9EQZf61dH9w/QyBl8 3SlRpQIcE4mVGa/OOmA4GUKVRVqDYCFgLed5CsLxWg91Rj/oQZtVKTF2SjC9ULue3tyK xf0zqtJICyS9JmGpURrl8SImvef9SN5dhSWi7ex7+xQ+YL+KWUsCltKwlB1lg4VnQoGp Qq2R4SbsVTtWC54SI5M9Z5+CE6KgEGXFSPjyWKGrnE/UNJBFA3FEcPb0xw1j3edNrQDX 0g9Q== X-Gm-Message-State: AOJu0Yxev+XoPztgzrVg61dfYMp7MQyVx1mAblK5qBxNcp0nseCitdI2 ZTxvaECIL3bdrcrJTGim7YtEn3bqMRY= X-Google-Smtp-Source: AGHT+IGJ25fW4BnP1NJYhrzH0X+zrhr1/eHne8PBOna8hmvrezOwpbGVvOl7JHFMC4rGhoY/sRPJncXHlfA= X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:45ba:3318:d7a5:336a]) (user=surenb job=sendgmr) by 2002:a05:6902:1083:b0:d9a:c946:c18c with SMTP id v3-20020a056902108300b00d9ac946c18cmr311395ybu.6.1698155219188; Tue, 24 Oct 2023 06:46:59 -0700 (PDT) Date: Tue, 24 Oct 2023 06:46:05 -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-9-surenb@google.com> Subject: [PATCH v2 08/39] 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, 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 X-Rspamd-Queue-Id: 42416100030 X-Rspam-User: X-Stat-Signature: shaou4inhd3peckptq77ga9mq5dwks8c X-Rspamd-Server: rspam03 X-HE-Tag: 1698155220-987299 X-HE-Meta: U2FsdGVkX19pn1IxEXmL8C3aDGP2PqsN16gtJIpV2qa9tAkWlGPTYdRvqtKThGMja8n8TwbxVLK9LJZF8MzoJOd5zVGVDAomjDCNcJAheuN68iVz6SLm+ASh6K5GQrOgUPPg/qvuAYXcG4ET2zJn775Dn7HTxo220pc1WGUw//DNu1xf+JEVXtvE8w2gZ+LCnWV3f8XmY+uNc8YHOn3hyn/cRpki1iZNff5FvFxkQ8E3En/l93rpiWQwHbwcnq6QR6wFQxRsBqDTppkHcmL6Ih0YklAAdcexWdAHeI3cv05+9ufufYN8Qp8TosffsHgX0P6uswxkWB/D6sW6bV6HphA3EzG/4ILJWfUB4nH4p/yVPj2miktc7fJI1oSBUlgoaHUqFSCabcmms2h3a3U3RXxADsdZqiWAvh5+6lPfWD2BemSwhv7Z6o0wxhhs238F6ITZ5m0iR6sUYGAyes6DjcVdn44OYkSj4iFGWFc4b8kadeQnzZXgWr9g0rTQdqCB//aZ9EW2FJqGzUrLM0wlEPVh8r/1sj+AJZYujh9zTMLTPylktBRptFuiM9x1dIVlGM1bGYt+ckFHIs4Zmh8cWXgxJtCtX5Vqs1E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H7L5MypSwrdGww== 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: List-Subscribe: List-Unsubscribe: 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/gfp_types.h b/include/linux/gfp_types.h index 3fbe624763d9..1c6573d69347 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