--- zzzz-none-000/linux-4.4.60/include/linux/mm_types.h 2017-04-08 07:53:53.000000000 +0000 +++ hawkeye-5590-729/linux-4.4.60/include/linux/mm_types.h 2022-03-30 14:21:53.000000000 +0000 @@ -239,7 +239,16 @@ #endif }; +/* The 1200ax was not designed with enough memory, we need the workaround + * from the 1750e to get it working even on product launch. + * Drop PAGE_FRAG_CACHE from 32768 -> 8192 + */ +#ifdef CONFIG_AVM_OOM_MITIGATION_PAGE_FRAG_CACHE +#define PAGE_FRAG_CACHE_MAX_SIZE __ALIGN_MASK(8192, ~PAGE_MASK) +#else #define PAGE_FRAG_CACHE_MAX_SIZE __ALIGN_MASK(32768, ~PAGE_MASK) +#endif + #define PAGE_FRAG_CACHE_MAX_ORDER get_order(PAGE_FRAG_CACHE_MAX_SIZE) struct page_frag_cache { @@ -368,10 +377,14 @@ struct completion startup; }; +#define AVM_ENH_SWAP_STATS 1 + enum { MM_FILEPAGES, MM_ANONPAGES, MM_SWAPENTS, + MM_SWAPOUTS, + MM_SWAPINS, NR_MM_COUNTERS }; @@ -392,7 +405,7 @@ struct mm_struct { struct vm_area_struct *mmap; /* list of VMAs */ struct rb_root mm_rb; - u32 vmacache_seqnum; /* per-thread vmacache */ + u64 vmacache_seqnum; /* per-thread vmacache */ #ifdef CONFIG_MMU unsigned long (*get_unmapped_area) (struct file *filp, unsigned long addr, unsigned long len,