Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1288274rdb; Fri, 16 Feb 2024 10:42:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUAL8wPFeUq5IQQdj6EhTzzmxgcoYflPKzeLIa+TavfYKcLv9MwHNf4rL5XnchB3e94ItT8jzWvXcVhf8BDDTV8rWL/sjGIwLQEPoDfkg== X-Google-Smtp-Source: AGHT+IGQCCtJIvfdKTYMdWChY2frOaHE6EZgc8uPxPkzexZRc9EU3a0ZuQ8/qGTKZaB8vhpCOuH/ X-Received: by 2002:a17:906:7196:b0:a3c:7b20:2dfb with SMTP id h22-20020a170906719600b00a3c7b202dfbmr4559382ejk.1.1708108955370; Fri, 16 Feb 2024 10:42:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708108955; cv=pass; d=google.com; s=arc-20160816; b=TNtRhS4nsan0FC/6rSB2iSsyRoBr44+Mo2WmXhgVxiICJhJziUNm7g7b5kn56QxEmW 8EzOWl5eQjeYQgD6hdgu6/sFfge9ToODsH+DJrQ6ZxXgMp1Iv9qMtPNKG74XqjkyKuuC q50iv/GTIR0dJZIgeik+q6gs10zb6B/hLE/zK1TvjD6UR9IhTWhmIosHkyBPced+VI8G If98oabHDroozqt4E1iIfCkwLtTKrbUGBIbQuYNzSA6wUy1ZSnsOXwy7agi/QUj24jnY bworep1dxvH+Sv9Jir2zNhEkDZKaYwjvWpEqp/RwdvcvNcS+a59LIsScJtEAgpnjT4+f GBkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=faKyGS2bCJ2px0ud+d+mBkv9JBZNScCq7HyfBnLgGJM=; fh=lFgruWGtuEri+NxzPxjutKbFHjcM4r9y5ktMnumOuZk=; b=HkbMkezcC3MO+Gzgz6wfBsRyuu/vKB8rPe2l2n2Px1qgpVJKnvxGMusOB65Q8Q52eH Gw58PTILtl97NtwAJ+j4LLE0fiK88OcQQdUZPtlL8e0v9hLYw0FbAIC7kYoxTjb5g4fO lcgt12e3S5gLyDNyRygMf8UeZqprixeFnlaXCJwx4NBf6F/tSvxuoWXk9acqw1PjfX5W +jXltr8oZuCQkgIxp+qILLXjBtJlsNl+/8oUOE8SOA77eax+DNi5GF5lbTRFeORQQr7R 386s+nEF8jyZW/FBc/r9UgA35QUeg+bTWTSxnAwUN97JFusowQn2iFLwkmcZEdpq/uJY q0kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mea7BVyU; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-69180-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jp11-20020a170906f74b00b00a3e15c5dbb4si1045ejb.852.2024.02.16.10.42.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 10:42:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69180-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Mea7BVyU; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-69180-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69180-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5574F1F21AE5 for ; Fri, 16 Feb 2024 18:42:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04B8C135A59; Fri, 16 Feb 2024 18:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Mea7BVyU" Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (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 9C6AA13541B for ; Fri, 16 Feb 2024 18:42:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708108923; cv=none; b=KjIPoJhroNCi4rqtGVIYjj39PTFBKnVmOSOyoutFmXwuZkNHm9I0K9x+QZGzdPJWe1Kj47b3Y/bwbVkrKlWTufV6vRdRD3dVWHXeje5Ue1QcULa03hUlpuPNfejwnfAsAAiDvreb0ORUqZgYYEIVkg7hYx3EbOUFTndIs269y4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708108923; c=relaxed/simple; bh=A1KZCaXPLmV5IjKi0NDr6st7BWpbT8lR31nOuGGGMbY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rhmTe/ZZPVEEMxjM1rX0Y66bEi3cReBU+8RT73a8tCyW79+Ir0hbcwEabnYnzCHNv802U81AaHTdVzrfPcP7OfEjNdrmBMACSCZvdQYCJ1pgr7IlG7gBu/UJB8rEw4UC9TjKzxlK8ZUwHjPgitAk0+2Hq88zrrXoYCZ5wqiPiiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Mea7BVyU; arc=none smtp.client-ip=209.85.219.179 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=google.com Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-dc25e12cc63so2979311276.0 for ; Fri, 16 Feb 2024 10:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708108919; x=1708713719; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=faKyGS2bCJ2px0ud+d+mBkv9JBZNScCq7HyfBnLgGJM=; b=Mea7BVyUlXEFyCFvx4rOU9zhyLwQqcBCUmAVisqF8k+pk4wSx3YyEsA2ZMeRpC8b5w 9A/w5iCDQNKLuSRh+HDGKX8HvZeIptQC2Z/DM3f+9DJUkNDv2fxFogmiEMWJPHBVfX8L NtoaJujQN7wTZ/ktPpBfYyx9k+dc0zEorMI4vlIh18OEJdx8p4ktiRKnkpnEDNxK8JvL rsfQBcVDFz66CI2nLusWb4O3ZHwfqXEujnJ4xU7Tx2aVyRFgbQfioOaanu7vjRs9y1Sr yDZ/qQFP5ThZolEK/1bFCs94Ock1+fscCgg06uR7MkHTbBAA4t5UKktqb42D6YNuGrMp ahaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708108919; x=1708713719; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=faKyGS2bCJ2px0ud+d+mBkv9JBZNScCq7HyfBnLgGJM=; b=APVXxIwiITBwcUXCsRlCVYpIwx3aN6MJ1PyREatL1x5IFu96PvCrXJYASvl1Hp/hM4 YjSEDlYUGxlNw/SCEjs5zIUbagwchbZXWBzbUgFbJz2Zm7kUfFD5FE6c9XRAT9W6Z/ZD UTOR6leke3MC7aXjHuiiNaSDcyQGQuuQu9In8uLHwXV2G4tJTIIE9BURL1fotciXl9UD ISfpQQoLZfDowEuYnWfLW1IT6lgMS4UgUgqnLwNr5n7zJfuVmJi5e9kVblmY+20hYVs4 JIrC7bcJ/QxJY7mwE97uM8L/15mbYZuVlAdtubdEf/VpsjadetyGEoIuNH3wDllZg7UA Z4Wg== X-Forwarded-Encrypted: i=1; AJvYcCXw7YAFySEPGYLZtn8+UZjnJWYIf/dV1c0vCJwYjtufcKcylA6PqNI3aD18YIwtrXRMqcgGJO8KwD14uXH684yn8dP7vAd4Ewf/OGJW X-Gm-Message-State: AOJu0YwlRB2D8rkluoQSxNSWIBmV4FFP0AnOl1DNZmEYGF8yKwsoVeoh c7wf2a2R3AVaLeurMfsL2PkAzx3DfNEJj+cJc00nykjDFKHpYeYsiWbrKxPWH+7S9DIMlCeQNxw TLAh7BiGGiCiaut/pnaDnjQsurDYdwcc/YcLc X-Received: by 2002:a25:fc23:0:b0:dc2:3a05:489 with SMTP id v35-20020a25fc23000000b00dc23a050489mr4194145ybd.14.1708108919211; Fri, 16 Feb 2024 10:41:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240212213922.783301-1-surenb@google.com> <20240212213922.783301-8-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Fri, 16 Feb 2024 18:41:46 +0000 Message-ID: Subject: Re: [PATCH v3 07/35] mm/slab: introduce SLAB_NO_OBJ_EXT to avoid obj_ext creation To: Vlastimil Babka Cc: Kent Overstreet , akpm@linux-foundation.org, mhocko@suse.com, 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, 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, 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" Content-Transfer-Encoding: quoted-printable On Thu, Feb 15, 2024 at 10:10=E2=80=AFPM Suren Baghdasaryan wrote: > > On Thu, Feb 15, 2024 at 1:50=E2=80=AFPM Vlastimil Babka = wrote: > > > > On 2/15/24 22:37, Kent Overstreet wrote: > > > On Thu, Feb 15, 2024 at 10:31:06PM +0100, Vlastimil Babka wrote: > > >> On 2/12/24 22:38, Suren Baghdasaryan wrote: > > >> > Slab extension objects can't be allocated before slab infrastructu= re is > > >> > initialized. Some caches, like kmem_cache and kmem_cache_node, are= created > > >> > before slab infrastructure is initialized. Objects from these cach= es can't > > >> > have extension objects. Introduce SLAB_NO_OBJ_EXT slab flag to mar= k these > > >> > caches and avoid creating extensions for objects allocated from th= ese > > >> > slabs. > > >> > > > >> > Signed-off-by: Suren Baghdasaryan > > >> > --- > > >> > include/linux/slab.h | 7 +++++++ > > >> > mm/slub.c | 5 +++-- > > >> > 2 files changed, 10 insertions(+), 2 deletions(-) > > >> > > > >> > diff --git a/include/linux/slab.h b/include/linux/slab.h > > >> > index b5f5ee8308d0..3ac2fc830f0f 100644 > > >> > --- a/include/linux/slab.h > > >> > +++ b/include/linux/slab.h > > >> > @@ -164,6 +164,13 @@ > > >> > #endif > > >> > #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Obje= cts are short-lived */ > > >> > > > >> > +#ifdef CONFIG_SLAB_OBJ_EXT > > >> > +/* Slab created using create_boot_cache */ > > >> > +#define SLAB_NO_OBJ_EXT ((slab_flags_t __force)0x20000000= U) > > >> > > >> There's > > >> #define SLAB_SKIP_KFENCE ((slab_flags_t __force)0x20000000= U) > > >> already, so need some other one? > > Indeed. I somehow missed it. Thanks for noticing, will fix this in the > next version. Apparently the only unused slab flag is 0x00000200U, all others seem to be taken. I'll use it if there are no objections. > > > > > > > What's up with the order of flags in that file? They don't seem to > > > follow any particular ordering. > > > > Seems mostly in increasing order, except commit 4fd0b46e89879 broke it = for > > SLAB_RECLAIM_ACCOUNT? > > > > > Seems like some cleanup is in order, but any history/context we shoul= d > > > know first? > > > > Yeah noted, but no need to sidetrack you.