[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081022092736.2a0795d1@lxorguk.ukuu.org.uk>
Date: Wed, 22 Oct 2008 09:27:36 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: hooanon05@...oo.co.jp
Cc: linux-kernel@...r.kernel.org
Subject: Re: __vm_enough_memory(), OVERCOMMIT_NEVER, current->mm, kernel
thread
> 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
--
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