Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp727896rdb; Thu, 22 Feb 2024 19:12:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDNyCf1QlLC/8FEPII6Ipb9lzCXcrnbKu9QqNWa+fhpU5m1fmzqryiJJsBdCuMEfCC3md2MoDiubaqoubjYoT2UyvsDmckIswQUwuRNA== X-Google-Smtp-Source: AGHT+IHHFslJwM47oZ+j3AjBZFdTBh/rw9hPggWO7pzz+Xc9JcZg17RVVr+Va2+zjTFBxH31XXb9 X-Received: by 2002:a05:620a:2146:b0:785:db0b:c010 with SMTP id m6-20020a05620a214600b00785db0bc010mr706827qkm.56.1708657942578; Thu, 22 Feb 2024 19:12:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708657942; cv=pass; d=google.com; s=arc-20160816; b=UskLBk59Q2rAZHTARQ3nd5j5TCZfVJPSlm4H8cf1zkrUiIt/vBFGsIXAetBmF8Tj41 RJ7Lsfpn90nbis0jJmUi7HMOtvQEVGWrETHYZOGlIQRNcrB7FexQJ7OGUQMXLp3Ss6rn 2nCIMysSXJxoq+D0cdMNroyNlz2wKJguStNxIO9NAhOGZCEn2iwJrZkHvl+wCN198qCF xs5OG72/48b085s1IUD5ne3RT73iL5XrA77LnDi5pz5NodS1SQEWjLTCCVfMMby+nWw2 DwoIvbHMbvZBogQ5wC+acKnoOmfTFwiD4yDYDEkZQ2HZ1VAKVfpsKl/vsUYYwouA71FS qxbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date; bh=TrygkVLNhCED6wwr6Qls1CAsyMtpXogljZl8GcwaQuE=; fh=s3ytm2/rSH/zXJfnbD0DPj/vb53awWdJKtdHzhgwnI0=; b=roBipuOKatgLbuQ/enSOg1pYKP41j/hOjdHmkzAgjVc8gYkJXToKPyHUC1Usy30iUw CxnUvhyuOXNsZPEtbjpOEz9GU2xWyC8ih3c2+ot2lpVfxwaW/wovXSpEI6fYzMtfm9hT toX+qm8+CcGPKmMpSzl1Dh5rExC173olI5CXaI+17cryCAfHI2JvIqcGsurK+qNB0HX+ 3iRQzPCod4R5UhLAwZDx5T/AEgLShnPnbuAZ+f368fvWyjl8kye4QGqHmc8LnbVgJvPY mTcFSIbA+Kn29oWZKwk9ByKQznkG4+FiE7rqvtf03gYboXfnvPIvrv0RNXP9hUaJ3dKa jlFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-77705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id qp6-20020a05620a388600b0078773829b67si7814665qkn.142.2024.02.22.19.12.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 19:12:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-77705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 541481C223ED for ; Fri, 23 Feb 2024 03:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 659C510A24; Fri, 23 Feb 2024 03:12:17 +0000 (UTC) Received: from gentwo.org (gentwo.org [62.72.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D303B10A01 for ; Fri, 23 Feb 2024 03:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.72.0.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708657936; cv=none; b=UCue/DJQz0K9Iy50P6c2tUuLSitMEeAW8T/8ej7pyUJ1hDfmqprTUaKFB+yYOJB/vXqAR6nJ5Nl78Ti3c1B2nr+uFc/jd/xvZvqzlZVMbwzHrnKqLMc10Npw0cl5dby+P4E+Lvwwg9XQgPhr6yae5tr7onReH+w+qFhwPHKDtFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708657936; c=relaxed/simple; bh=IfE0Mw15HNypz38gIE6amDvs+YXN4zqJPoCZprGys4c=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=ji17z+6ODoc9o8LG51wngk2U8B/XCmmcftITpvq8Dz33RLCXtTIqJ1rJWcdQ+XuTpswbozSaqxNSbztnzPTx80kjq6DCjbyOA5bZEY/58lQznsBJh88Lz0RkKFJlVLA/uC5Jn72w+pTYVY9e7GW3mrrw5KeC9hzeDxJqUv/r7EE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=fail smtp.mailfrom=linux.com; arc=none smtp.client-ip=62.72.0.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=linux.com Received: by gentwo.org (Postfix, from userid 1003) id 155E640AA8; Thu, 22 Feb 2024 19:12:14 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 14C8D40788; Thu, 22 Feb 2024 19:12:14 -0800 (PST) Date: Thu, 22 Feb 2024 19:12:14 -0800 (PST) From: "Christoph Lameter (Ampere)" To: Vlastimil Babka cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Zheng Yejian , Xiongwei Song , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Subject: Re: [PATCH 2/3] mm, slab: use an enum to define SLAB_ cache creation flags In-Reply-To: <20240220-slab-cleanup-flags-v1-2-e657e373944a@suse.cz> Message-ID: <8bc31ec7-5d6e-b4c0-9d6e-42849673f35f@linux.com> References: <20240220-slab-cleanup-flags-v1-0-e657e373944a@suse.cz> <20240220-slab-cleanup-flags-v1-2-e657e373944a@suse.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Tue, 20 Feb 2024, Vlastimil Babka wrote: > diff --git a/mm/slub.c b/mm/slub.c > index 2ef88bbf56a3..a93c5a17cbbb 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -306,13 +306,13 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s) > > /* Internal SLUB flags */ > /* Poison object */ > -#define __OBJECT_POISON ((slab_flags_t __force)0x80000000U) > +#define __OBJECT_POISON __SF_BIT(_SLAB_OBJECT_POISON) > /* Use cmpxchg_double */ > > #ifdef system_has_freelist_aba > -#define __CMPXCHG_DOUBLE ((slab_flags_t __force)0x40000000U) > +#define __CMPXCHG_DOUBLE __SF_BIT(_SLAB_CMPXCHG_DOUBLE) > #else > -#define __CMPXCHG_DOUBLE ((slab_flags_t __force)0U) > +#define __CMPXCHG_DOUBLE 0 > #endif Maybe its good to put these internal flags together with the other flags. After all there is no other slab allocator available anymore and having them all together avoids confusion.