fix out of memory handling
commit149d8741b1b5ecfa8f30643da32636978728f8c4
authorDan Carpenter <error27@gmail.com>
Sat, 21 Aug 2010 09:36:24 +0000 (21 11:36 +0200)
committerDan Carpenter <error27@gmail.com>
Sat, 21 Aug 2010 09:36:24 +0000 (21 11:36 +0200)
treee17ee9879f6f5e96cb6511f2e6810cdab92b5afd
parent7cbc9609af617f1d95d5ca0ac169f3df247202d3
fix out of memory handling

The original code tried to limit the memory to 800M, which is wrong
because my EEE only has 1G or memory.

Also it tested how much memory by reading a proc file which was slow and
the proc file still said you were using too much memory after you freed
a bunch of stuff.  It was terribly bad.

The new way basically says you can use 50M for sm_states.  Of course smatch
uses a lot of other memory besides just the stuff for sm_states so the
actual max memory used is almost 10 times that amount.  But that's Ok.

The new way of checking for OOM is much faster so we can do it more often.
Checking in merge_slist() is a huge improvement.

There are 6 functions in the kernel where smatch bails because they are
too hairy.  Those functions used to drag my system to a halt and then get
killed by the kernel's OOM killer on my system.  So this seems to work
great.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Makefile
smatch.c
smatch.h
smatch_implied.c
smatch_oom.c [deleted file]
smatch_slist.c
smatch_slist.h