Re: Overcommit_memory logic fails when swap is off

From: Alan Cox (
Date: Wed Aug 21 2002 - 12:23:39 EST

On Wed, 2002-08-21 at 18:11, Josip Loncaric wrote:
> Hello,
> I've found some minor logic flaws in mmap.c::vm_enough_memory() which you may
> want to fix. The problem is simple: overcommit_memory strategies "2" and "3"
> misbehave on machines operated without swap space. Strategy "2" results in a
> very restrictive memory policy, while strategy "3" crashes the system because
> no memory can be allocated when total_swap_pages is zero. May I suggest that

The behaviour it provides is correct and intentional. The documentation
is also quite plain on the fact you need swap for mode 3.

Since the kernel needs memory for its own purposes you cannot run
swapless with no overcommit and allow user space all of memory.

2.5 propses including the ability to set the %age between the 0% of mode
3, the 50 of mode 2 and upwards to things relevant in some embedded
system cases. So for 2.6 you will be able to tune it in different ways
according to precise understanding of workload.

As far as your hang goes I'd grab a standard 2.4.19 or 2.4.19-ac4 kernel
and try that.

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 : Fri Aug 23 2002 - 22:00:23 EST