Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934863AbcJZUrU (ORCPT ); Wed, 26 Oct 2016 16:47:20 -0400 Received: from resqmta-ch2-04v.sys.comcast.net ([69.252.207.36]:45189 "EHLO resqmta-ch2-04v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932707AbcJZUrP (ORCPT ); Wed, 26 Oct 2016 16:47:15 -0400 Date: Wed, 26 Oct 2016 15:47:13 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Thomas Garnier cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Linux-MM , LKML , Greg Thelen Subject: Re: [PATCH v1] memcg: Prevent caches to be both OFF_SLAB & OBJFREELIST_SLAB In-Reply-To: Message-ID: References: <1477503688-69191-1-git-send-email-thgarnie@google.com> Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfIyIw5vjjl5cFZ7LQBrTqt55Z0QZOxvdrvhS+OcBaP9fkzuaQHjVc7nFokSzEisauHfZOMBSwXl2GY0vSTSqVUxPLQ1WObl6LyOnn4aNn0/NUKdnhTrj rECa5s8kmk8hXSvchCmm9fHQKyqXj9xWUMV52k4oY2BioPZHEvNRSKJz2olWvuga/JuLNsNlOm5SYTp+/rXd6pOFhGJvoEve9Ct+wDRGG8iSxjPfS35icuJU 2zrVaQ4K9WapNde6R4A2Y7iIItLVCOFBbPDO2z9jypYAJfAPD8PyDO/pyNXWJNqX6ZSlcSiGTHy2OZpPTdBGq2ER+TwFBzIJk38IXHtxUwpkZwAYwZWGHI3D Dj/ApbBzYOYkmvxqBt8FJXVWhrdjKlATfidRWDU6D5BNQLiT6R4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1971 Lines: 37 On Wed, 26 Oct 2016, Thomas Garnier wrote: > Okay, I think for SLAB we can allow everything except the two flags > mentioned here. No no no. Just allow the flags already defined in include/linux/slab.h that can be specd by subsystems when they call into the slab allocators. > Should I deny certain flags for SLUB? I can allow everything for now. All allocator should just allow flags defined in include/linux/slab.h be passed to kmem_cache_create(). That is the API that all allocators need to support. If someone wants to add new flags then we need to make sure that all allocators can handle it. The flags are (from include/linux/slab.h) /* * Flags to pass to kmem_cache_create(). */ #define SLAB_CONSISTENCY_CHECKS 0x00000100UL /* DEBUG: Perform (expensive) checks on alloc/free */ #define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */ #define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */ #define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */ #define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */ #define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */ #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ #define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ #define SLAB_DEBUG_OBJECTS 0x00400000UL #define SLAB_NOLEAKTRACE 0x00800000UL /* Avoid kmemleak tracing #define SLAB_NOTRACK 0x01000000UL #define SLAB_FAILSLAB 0x02000000UL /* Fault injection mark */ #define SLAB_ACCOUNT 0x04000000UL /* Account to memcg */ #define SLAB_KASAN 0x08000000UL #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */