All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Carron, Thierry" <thierry.carron@hp.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [Linux-ia64] Re: VM strict overcommit on RedHat AS 2.1 kernel 2.4.18-e12 ?
Date: Mon, 27 Jan 2003 17:21:00 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709805754@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709805753@msgid-missing>

Hi,

in the file : Documentation/vm/overcommit-accounting :

The Linux kernel supports four overcommit handling modes

0       -       Heuristic overcommit handling. Obvious overcommits of
                address space are refused. Used for a typical system. It
                ensures a seriously wild allocation fails while allowing
                overcommit to reduce swap usage

1       -       No overcommit handling. Appropriate for some scientific
                applications

2       -       (NEW) strict overcommit. The total address space commit
                for the system is not permitted to exceed swap + half ram.
                In almost all situations this means a process will not be
                killed while accessing pages but only by malloc failures
                that are reported back by the kernel mmap/brk code.

3       -       (NEW) paranoid overcommit The total address space commit
                for the system is not permitted to exceed swap. The machine
                will never kill a process accessing pages it has mapped
                except due to a bug (ie report it!)

in the source code : mm/mmap.c
int vm_enough_memory(long pages, int charge)
{
        /* Stupid algorithm to decide if we have enough memory: while
         * simple, it hopefully works in most obvious cases.. Easy to
         * fool it, but this should catch most mistakes.
         *
         * 23/11/98 NJC: Somewhat less stupid version of algorithm,
         * which tries to do "TheRightThing".  Instead of using half of
         * (buffers+cache), use the minimum values.  Allow an extra 2%
         * of num_physpages for safety margin.
         *
         * 2002/02/26 Alan Cox: Added two new modes that do real accounting
         */
        unsigned long free, allowed;
        struct sysinfo i;

        if(charge)
                atomic_add(pages, &vm_committed_space);

        /* Sometimes we want to use more memory than we have. */
        if (sysctl_overcommit_memory == 1)
            return 1;
        if (sysctl_overcommit_memory == 0)
        {
          .....
        }
        if(sysctl_overcommit_memory == 2)
        {
                /* FIXME - need to add arch hooks to get the bits we need
                   without the higher overhead crap */
                si_meminfo(&i);
                allowed += i.totalram >> 1;
        }
        if(atomic_read(&vm_committed_space) < allowed)
                return 1;
        if(charge)
                atomic_sub(pages, &vm_committed_space);
        return 0;

}
Regards,
Thierry
PS: Unfortunatelly I will be out of office until the 3rd Febuary with no access to my mail box.


-----Message d'origine-----
De : Bill Nottingham [mailto:notting@redhat.com]
Envoyé : lundi 27 janvier 2003 17:36
À : Carron, Thierry
Cc : linux-ia64@linuxia64.org
Objet : [Linux-ia64] Re: VM strict overcommit on RedHat AS 2.1 kernel
2.4.18-e12 ?


Carron, Thierry (thierry.carron@hp.com) said: 
> I know that Alan Cox has a patch and that a lot of job is currently done in kernel 2.5 .
> This patch is partially integrated in the kernel 2.4.18-e12 delivered with the RedHat Advanced Server 2.1. 
> But there is a difference between the documentation  about overcommit_memory  in sysctl/vm.txt and the code really implemented in mm/mmap.c
> Is there any reason for that ?

What differences are you seeing between the documentation and the
code?

Bill

_______________________________________________
Linux-IA64 mailing list
Linux-IA64@linuxia64.org
http://lists.linuxia64.org/lists/listinfo/linux-ia64


      reply	other threads:[~2003-01-27 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-27 16:36 [Linux-ia64] Re: VM strict overcommit on RedHat AS 2.1 kernel 2.4.18-e12 ? Bill Nottingham
2003-01-27 17:21 ` Carron, Thierry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105590709805754@msgid-missing \
    --to=thierry.carron@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.