Messages in this thread | | | Date | Wed, 22 Oct 2008 09:27:36 +0100 | From | Alan Cox <> | 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
| |