Re: [PATCH v5 2/3] mm: memcg/slab: Create a new set of kmalloc-cg-<n> caches

From
Vlastimil Babka <hidden>
Date
2021-05-13 08:40:38
Also in
cgroups, lkml
Reply to
Andrew Morton, 2021-05-13
On 5/13/21 2:32 AM, Andrew Morton wrote:
On Wed, 12 May 2021 10:54:19 -0400 Waiman Long [off-list ref] wrote:
quoted
quoted
  include/linux/slab.h | 42 +++++++++++++++++++++++++++++++++---------
  mm/slab_common.c     | 25 +++++++++++++++++--------
  2 files changed, 50 insertions(+), 17 deletions(-)
The following are the diff's from previous version. It turns out that 
the previous patch doesn't work if CONFIG_ZONE_DMA isn't defined.
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a51cad5f561c..aa7f6c222a60 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -312,16 +312,17 @@ static inline void __check_heap_object(const void 
*ptr, un
signed long n,
   */
  enum kmalloc_cache_type {
      KMALLOC_NORMAL = 0,
-#ifdef CONFIG_MEMCG_KMEM
-    KMALLOC_CGROUP,
-#else
+#ifndef CONFIG_ZONE_DMA
+    KMALLOC_DMA = KMALLOC_NORMAL,
+#endif
+#ifndef CONFIG_MEMCG_KMEM
      KMALLOC_CGROUP = KMALLOC_NORMAL,
+#else
+    KMALLOC_CGROUP,
  #endif
      KMALLOC_RECLAIM,
  #ifdef CONFIG_ZONE_DMA
      KMALLOC_DMA,
-#else
-    KMALLOC_DMA = KMALLOC_NORMAL,
  #endif
      NR_KMALLOC_TYPES
  };
I assume this fixes
https://lkml.kernel.org/r/20210512152806.2492ca42@canb.auug.org.au (local)?
Yeah it should.
Thread (21 messages) 21 messages, 6 authors, last reply 2021-05-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help