Re: [PATCH] make vm_enough_memory more efficient

From: Martin J. Bligh (
Date: Thu Jan 16 2003 - 10:22:33 EST

>> vm_enough_memory seems to call si_meminfo just to get the total
>> RAM, which seems far too expensive. This replaces the comment
>> saying "this is crap" with some code that's less crap.
>> Not heavily tested (compiles and boots), but seems pretty obvious.
> Yup, obviously correct.

> The really hurtful part of vm_enough_memory() is the call to
> get_page_cache_size(), which has to go over every CPU's local VM statistics
> in get_page_state().
> But I guess you're running with sysctl_overcommit_memory != 0.

Yup, I manually disable that because it's so expensive. I'll see if
I can make the default case cheaper as well.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:13 EST