lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AD98412A5373CC4AA643D9C021922A541C4DCB@cdskitexg01.cds.int>
Date:	Tue, 10 Apr 2007 14:17:00 -0400
From:	"Mouawad, Tony" <Tony.Mouawad@...istiedigital.com>
To:	"Alan Cox" <alan@...rguk.ukuu.org.uk>
Cc:	"Robert Hancock" <hancockr@...w.ca>, <linux-kernel@...r.kernel.org>
Subject: RE: Help Understanding Linux memory management

If I understand you correctly, are you suggesting that in an embedded
system where there is no disk swapping, it makes sense to disable the
memory overcommit?

I'm testing a system with overcommit disabled and the overcommit ratio
set to 100%.  I am pleased with the fact that malloc() will actually
return NULL when we are about to exceed the commit limit.  If you look
at COMMITED_AS in /proc/meminfo, it looks to me like it reflects that
amount of memory currently allocated in the system.  I looked into
COMMIT_LIMIT and found that I can raise it to about 120% of physical or
so before the system is really out of memory.  When I load the system, I
see COMMITED_AS actually exceed the amount of physical RAM that I have.
Things appear to work.  My question now is how exactly is COMMITED_AS
calculated?


-----Original Message-----
From: Alan Cox [mailto:alan@...rguk.ukuu.org.uk] 
Sent: Tuesday, April 10, 2007 12:17 PM
To: Mouawad, Tony
Cc: Robert Hancock; linux-kernel@...r.kernel.org
Subject: Re: Help Understanding Linux memory management

On Tue, 10 Apr 2007 10:31:34 -0400
"Mouawad, Tony" <Tony.Mouawad@...istiedigital.com> wrote:

> When vm.overcommit_memory = 2 and there appears to be about 2M of
memory
> readily available and about 12M of memory allocated to pagecache (this
> is info gathered from /proc/meminfo) , a call to malloc(5000000)
returns
> NULL.  I would have expected that somehow, the call to malloc(5000000)
> would request the memory in pagecache to be released for use by the
app.

That can only be done if the memory in the page cache is not being used.
In a system with swap it is possible for anonymous pages to be pushed to
disk, on a system without swap only unchanged disk mapped pages such as
executable progam pages (some of them anyway) can be thrown out if they
are still in use.

More importantly overcommit is address *space* not pages. It deals with
the theoretical worst cases and ensure that a page write won't cause an
out of memory situation. That means it is more pessimistic than the
usual
workload. It also by default allows lots of room for worst case kernel
behaviour that is appropriate to a real system with swap but not
embedded
so you may well want to tune that via the overcommit ratio proc
interface

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ