debug: add some test patches to reduce or analyze memory usage
This commit is contained in:
parent
01336f70ec
commit
1b14f729cc
19
patches/lede/0066-generic-disable-CONFIG_PROC_STRIPPED.patch
Normal file
19
patches/lede/0066-generic-disable-CONFIG_PROC_STRIPPED.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Date: Mon, 27 Nov 2017 16:14:28 +0100
|
||||||
|
Subject: generic: disable CONFIG_PROC_STRIPPED
|
||||||
|
|
||||||
|
We want /proc/vmallocstat.
|
||||||
|
|
||||||
|
diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
|
||||||
|
index 4711fd7f5bff377a515b34629a5706839666884f..9c6ef6631efd91cd2ef5546d4855242b9b79f185 100644
|
||||||
|
--- a/target/linux/generic/config-4.4
|
||||||
|
+++ b/target/linux/generic/config-4.4
|
||||||
|
@@ -3036,7 +3036,7 @@ CONFIG_PRINT_STACK_DEPTH=64
|
||||||
|
CONFIG_PROC_FS=y
|
||||||
|
# CONFIG_PROC_KCORE is not set
|
||||||
|
# CONFIG_PROC_PAGE_MONITOR is not set
|
||||||
|
-CONFIG_PROC_STRIPPED=y
|
||||||
|
+# CONFIG_PROC_STRIPPED is not set
|
||||||
|
CONFIG_PROC_SYSCTL=y
|
||||||
|
# CONFIG_PROFILE_ALL_BRANCHES is not set
|
||||||
|
# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
|
@ -0,0 +1,17 @@
|
|||||||
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Date: Mon, 27 Nov 2017 16:15:20 +0100
|
||||||
|
Subject: generic: reduce fq_codel per-queue memory limit to 1MB
|
||||||
|
|
||||||
|
diff --git a/target/linux/generic/patches-4.4/660-fq_codel_defaults.patch b/target/linux/generic/patches-4.4/660-fq_codel_defaults.patch
|
||||||
|
index 46fceffcf174f4b37a9a0aac9eba1d1e0505ef24..4e65f3afc2cf850991a03830110eb8440bb78c2d 100644
|
||||||
|
--- a/target/linux/generic/patches-4.4/660-fq_codel_defaults.patch
|
||||||
|
+++ b/target/linux/generic/patches-4.4/660-fq_codel_defaults.patch
|
||||||
|
@@ -5,7 +5,7 @@
|
||||||
|
sch->limit = 10*1024;
|
||||||
|
q->flows_cnt = 1024;
|
||||||
|
- q->memory_limit = 32 << 20; /* 32 MBytes */
|
||||||
|
-+ q->memory_limit = 4 << 20; /* 4 MBytes */
|
||||||
|
++ q->memory_limit = 1 << 20; /* 1 MBytes */
|
||||||
|
q->drop_batch_size = 64;
|
||||||
|
q->quantum = psched_mtu(qdisc_dev(sch));
|
||||||
|
q->perturbation = prandom_u32();
|
@ -0,0 +1,43 @@
|
|||||||
|
From: Matthias Schiffer <mschiffer@universe-factory.net>
|
||||||
|
Date: Mon, 27 Nov 2017 16:39:51 +0100
|
||||||
|
Subject: mac80211: fq_impl: Properly enforce memory limit
|
||||||
|
|
||||||
|
diff --git a/package/kernel/mac80211/patches/095-fq_impl-Properly-enforce-memory-limit.patch b/package/kernel/mac80211/patches/095-fq_impl-Properly-enforce-memory-limit.patch
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..83b5c259195a121909dae70992d199987c8b262c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/package/kernel/mac80211/patches/095-fq_impl-Properly-enforce-memory-limit.patch
|
||||||
|
@@ -0,0 +1,33 @@
|
||||||
|
+--- a/include/net/fq_impl.h
|
||||||
|
++++ b/include/net/fq_impl.h
|
||||||
|
+@@ -146,6 +146,7 @@ static void fq_tin_enqueue(struct fq *fq
|
||||||
|
+ fq_flow_get_default_t get_default_func)
|
||||||
|
+ {
|
||||||
|
+ struct fq_flow *flow;
|
||||||
|
++ bool oom;
|
||||||
|
+
|
||||||
|
+ lockdep_assert_held(&fq->lock);
|
||||||
|
+
|
||||||
|
+@@ -167,8 +168,8 @@ static void fq_tin_enqueue(struct fq *fq
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ __skb_queue_tail(&flow->queue, skb);
|
||||||
|
+-
|
||||||
|
+- if (fq->backlog > fq->limit || fq->memory_usage > fq->memory_limit) {
|
||||||
|
++ oom = (fq->memory_usage > fq->memory_limit);
|
||||||
|
++ while (fq->backlog > fq->limit || oom) {
|
||||||
|
+ flow = list_first_entry_or_null(&fq->backlogs,
|
||||||
|
+ struct fq_flow,
|
||||||
|
+ backlogchain);
|
||||||
|
+@@ -183,8 +184,10 @@ static void fq_tin_enqueue(struct fq *fq
|
||||||
|
+
|
||||||
|
+ flow->tin->overlimit++;
|
||||||
|
+ fq->overlimit++;
|
||||||
|
+- if (fq->memory_usage > fq->memory_limit)
|
||||||
|
++ if (oom) {
|
||||||
|
+ fq->overmemory++;
|
||||||
|
++ oom = (fq->memory_usage > fq->memory_limit);
|
||||||
|
++ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
@ -21,6 +21,8 @@ config '# CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set'
|
|||||||
|
|
||||||
config 'CONFIG_PACKAGE_ATH_DEBUG=y'
|
config 'CONFIG_PACKAGE_ATH_DEBUG=y'
|
||||||
|
|
||||||
|
config 'CONFIG_KERNEL_SLABINFO=y'
|
||||||
|
|
||||||
try_config 'CONFIG_TARGET_MULTI_PROFILE=y'
|
try_config 'CONFIG_TARGET_MULTI_PROFILE=y'
|
||||||
try_config 'CONFIG_TARGET_PER_DEVICE_ROOTFS=y'
|
try_config 'CONFIG_TARGET_PER_DEVICE_ROOTFS=y'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user