aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-05 09:49:00 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-03-28 14:28:03 -0400
commita762d76fd455b26b84d7f43a047cd85f09ec4ee3 (patch)
tree7adb769a4f85c564e8446c1b83e3bf6f8c89550a
parent10ef4ac47941c9619179a2540c3f2fac7c6c0f66 (diff)
smatch_slist: use a higher memory limit
50M is not enough for some code at the Kernel. It produces this warning: drivers/media/pci/cx23885/cx23885-dvb.c:2046 dvb_register() Function too hairy. Giving up. While checking for troubles on a loop with attaches the device specific sub-devices based on the PCI ID. There's not much that could be done at the code to simplify it. The code there is big just because the cx23885 driver supports lots of different cards. On the other hand, increasing the maximum memory size to 500MB is cheap, as nowadays even desktops have 16GB. So, let's increase it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--smatch_flow.c2
-rw-r--r--smatch_implied.c3
-rw-r--r--smatch_slist.c6
3 files changed, 7 insertions, 4 deletions
diff --git a/smatch_flow.c b/smatch_flow.c
index 808a7bdb8..6b941871f 100644
--- a/smatch_flow.c
+++ b/smatch_flow.c
@@ -1061,7 +1061,7 @@ void __split_stmt(struct statement *stmt)
__bail_on_rest_of_function = 1;
final_pass = 1;
- sm_perror("Function too hairy. Giving up. %lu seconds",
+ sm_msg("__split_smt: function too hairy. Giving up after %lu seconds",
stop.tv_sec - fn_start_time.tv_sec);
fake_a_return();
final_pass = 0; /* turn off sm_msg() from here */
diff --git a/smatch_implied.c b/smatch_implied.c
index f57625f57..2e317b830 100644
--- a/smatch_implied.c
+++ b/smatch_implied.c
@@ -581,8 +581,9 @@ static void separate_and_filter(struct sm_state *sm, int comparison, struct rang
gettimeofday(&time_after, NULL);
sec = time_after.tv_sec - time_before.tv_sec;
- if (sec > 20)
+ if (sec > 60) {
sm_perror("Function too hairy. Ignoring implications after %d seconds.", sec);
+ }
}
static struct expression *get_last_expr(struct statement *stmt)
diff --git a/smatch_slist.c b/smatch_slist.c
index ef0046559..d561430a3 100644
--- a/smatch_slist.c
+++ b/smatch_slist.c
@@ -288,12 +288,14 @@ int out_of_memory(void)
return 1;
/*
- * I decided to use 50M here based on trial and error.
+ * I decided to use 6GB here based on trial and error.
* It works out OK for the kernel and so it should work
* for most other projects as well.
*/
- if (sm_state_counter * sizeof(struct sm_state) >= 100000000)
+ if (sm_state_counter * sizeof(struct sm_state) >= 6000000000) {
+ sm_msg("Out of memory");
return 1;
+ }
/*
* We're reading from statm to figure out how much memory we

Privacy Policy