--- zzzz-none-000/linux-4.4.60/include/linux/slab.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/include/linux/slab.h 2021-02-04 17:41:59.000000000 +0000 @@ -26,7 +26,18 @@ #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_STORE_USER_LITE 0x00020000UL /* AVM: need for slab_allocator usage */ #define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */ +#define SLAB_PANIC_CORRUPTION 0x00080000UL /* Panic if alloc/free consistency check fails */ + +#if defined(CONFIG_DEBUG_SLAB_AVM_LITE) +#define SLAB_STORE_USER_AND_TIME 0x04000000UL /* DEBUG_SLAB_AVM_LITE: Store the last owner for oom-analyzing */ +#define SLAB_POISON_WRITE_AFTER_FREE 0x08000000UL /* DEBUG_SLAB_AVM_LITE: if poison on check write after free */ + +#if defined(CONFIG_DEBUG_SLAB) +#error conflict DEBUG_SLAB versus DEBUG_SLAB_AVM_LITE +#endif +#endif/*--- #if defined(CONFIG_DEBUG_SLAB_AVM_LITE) ---*/ /* * SLAB_DESTROY_BY_RCU - **WARNING** READ THIS! * @@ -182,15 +193,15 @@ #ifdef CONFIG_SLAB /* * The largest kmalloc size supported by the SLAB allocators is - * 32 megabyte (2^25) or the maximum allocatable page order if that is - * less than 32 MB. + * 1 megabyte (2^20) or the maximum allocatable page order if that is + * less than 1 MB. * * WARNING: Its not easy to increase this value since the allocators have * to do various tricks to work around compiler limitations in order to * ensure proper constant folding. */ -#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \ - (MAX_ORDER + PAGE_SHIFT - 1) : 25) +#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 20 ? \ + (MAX_ORDER + PAGE_SHIFT - 1) : 20) #define KMALLOC_SHIFT_MAX KMALLOC_SHIFT_HIGH #ifndef KMALLOC_SHIFT_LOW #define KMALLOC_SHIFT_LOW 5