kernel: modularize dma shared buffer code to eliminate kernel bloat
[oweals/openwrt.git] / target / linux / generic / patches-4.4 / 902-debloat_proc.patch
index 9f77858c5506c3bc2b3982e30facbf5e0c63787d..0740e9693b97f7eb586bf76079ca444a3bdaaae1 100644 (file)
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
 @@ -1553,10 +1553,12 @@ static int __init setup_vmstat(void)
-       vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
+       cpu_notifier_register_done();
  #endif
  #ifdef CONFIG_PROC_FS
 -      proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
        remove_proc_entry("dev", net->proc_net);
  }
  
+--- a/include/net/snmp.h
++++ b/include/net/snmp.h
+@@ -123,6 +123,30 @@ struct linux_xfrm_mib {
+ #define DECLARE_SNMP_STAT(type, name) \
+       extern __typeof__(type) __percpu *name
++#ifdef CONFIG_PROC_STRIPPED
++#define SNMP_INC_STATS_BH(mib, field) \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_INC_STATS_USER(mib, field)       \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_INC_STATS_ATOMIC_LONG(mib, field)        \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_INC_STATS(mib, field)    \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_DEC_STATS(mib, field)    \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_ADD_STATS_BH(mib, field, addend) \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_ADD_STATS_USER(mib, field, addend)       \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_ADD_STATS(mib, field, addend)    \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_UPD_PO_STATS(mib, basefield, addend)     \
++      do { (void) mib->mibs[0]; } while(0)
++#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend)  \
++      do { (void) mib->mibs[0]; } while(0)
++
++#else
++
+ #define SNMP_INC_STATS_BH(mib, field) \
+                       __this_cpu_inc(mib->mibs[field])
+@@ -159,8 +183,9 @@ struct linux_xfrm_mib {
+               __this_cpu_add(ptr[basefield##OCTETS], addend); \
+       } while (0)
++#endif
+-#if BITS_PER_LONG==32
++#if (BITS_PER_LONG==32) && !defined(CONFIG_PROC_STRIPPED)
+ #define SNMP_ADD_STATS64_BH(mib, field, addend)                       \
+       do {                                                            \