--- zzzz-none-000/linux-4.4.271/include/linux/mm.h 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/include/linux/mm.h 2023-01-11 09:25:43.000000000 +0000 @@ -30,6 +30,11 @@ struct writeback_control; struct bdi_writeback; +#if defined(CONFIG_AVM_PAGE_TRACE) +unsigned long avm_get_page_current_pc(struct page *page); +void avm_set_page_current_pc(struct page *page, unsigned long pc); +#endif/*--- #if defined(CONFIG_AVM_PAGE_TRACE) ---*/ + #ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr; @@ -540,7 +545,18 @@ void put_page(struct page *page); void put_pages_list(struct list_head *pages); -void split_page(struct page *page, unsigned int order); +void __split_page(struct page *page, unsigned int order +#if defined(CONFIG_AVM_PAGE_TRACE) + , unsigned long pc +#endif + ); + +#if defined(CONFIG_AVM_PAGE_TRACE) +#define split_page(page, order) __split_page(page, order, _RET_IP_) +#else +#define split_page(page, order) __split_page(page, order) +#endif + int split_free_page(struct page *page); /* @@ -1842,6 +1858,10 @@ /* page_alloc.c */ extern int min_free_kbytes; +#ifndef CONFIG_NUMA +extern int min_max_free_kbytes[2]; +#endif /* CONFIG_NUMA */ + /* nommu.c */ extern atomic_long_t mmap_pages_allocated; extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); @@ -2013,7 +2033,12 @@ void task_dirty_inc(struct task_struct *tsk); /* readahead.c */ -#define VM_MAX_READAHEAD 128 /* kbytes */ +#if defined (CONFIG_AVM_KERNEL) + /* 20160725 AVM/VGJ larger USB storage transfers for more speed */ + #define VM_MAX_READAHEAD 512 /* kbytes */ +#else + #define VM_MAX_READAHEAD 128 /* kbytes */ +#endif #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ int force_page_cache_readahead(struct address_space *mapping, struct file *filp, @@ -2368,5 +2393,15 @@ static inline void setup_nr_node_ids(void) {} #endif +#ifdef CONFIG_MTD_AVM_MTDRAM +int __init avm_mtdram_mem_reserve(void); +#else +static inline int avm_mtdram_mem_reserve(void) { return 0; } +#endif + +#ifdef CONFIG_DEBUG_MEM_USAGE +extern int debug_mem_usage_enabled; +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */