mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: hooanon05@yahoo.co.jp
Cc: linux-kernel@vger.kernel.org
Subject: Re: __vm_enough_memory(), OVERCOMMIT_NEVER, current->mm, kernel thread
Date: Wed, 22 Oct 2008 09:27:36 +0100	[thread overview]
Message-ID: <20081022092736.2a0795d1@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <6775.1224630654@jrobl>

> In your first option, write() to the exported tmpfs will produce the
> warning on nfs server even if much memory is left. I don't think it is a

No - the shmem routine would use vm_enough_memory_fs which wouldn't care
if current->mm is NULL, but the others would check.

> good idea.
> I'd suggest to make __vm_enough_memory() would skip the 3% adjustment
> only.
> 
> --- /src/linux-2.6/linux-2.6.27/mm/mmap.c	2008-10-10 07:13:53.000000000 +0900
> +++ /tmp/mmap.c	2008-10-22 08:07:09.000000000 +0900
> @@ -173,9 +173,10 @@
>  		allowed -= allowed / 32;
>  	allowed += total_swap_pages;
>  
> -	/* Don't let a single process grow too big:
> +	/* Don't let a single user process grow too big:
>  	   leave 3% of the size of this process for other processes */
> -	allowed -= mm->total_vm / 32;
> +	if (mm)
> +		allowed -= mm->total_vm / 32;

Doing this means we lose the ability to trap incorrect calls to
vm_enough_memory.

Alan

  parent reply	other threads:[~2008-10-22  8:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 15:14 hooanon05
2008-10-21 15:46 ` Alan Cox
2008-10-21 23:10   ` hooanon05
2008-10-22  5:35     ` hooanon05
2008-10-22  8:27     ` Alan Cox [this message]
2008-10-22 11:26       ` hooanon05
2008-10-22 12:09         ` Alan Cox
2008-10-22 12:46           ` hooanon05
2008-10-22 13:37           ` James Morris

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=20081022092736.2a0795d1@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=hooanon05@yahoo.co.jp \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®