Re: [PATCH] kernel/fork.c: VM accounting bugfix (2.6.11-rc3-bk5)

From: Hugh Dickins (hugh@private)
Date: Wed Feb 09 2005 - 04:30:24 PST


On Tue, 8 Feb 2005, Chris Wright wrote:
> * Mark F. Haigh (Mark.Haigh@private) wrote:
> > 
> > If security_vm_enough_memory() fails there, then we vm_unacct_memory()
> > that we never accounted (if security_vm_enough_memory() fails, no memory
> > is accounted).
> 
> You missed one subtle point.  That failure case actually unaccts 0 pages
> (note the use of charge).  Not the nicest, but I believe correct.

Not quite: Mark's patch is worse than unnecessary, it's wrong.

dup_mmap's charge starts out at 0 and gets added to each time around
the loop through vmas; if security_vm_enough_memory fails at any point
in that loop, we need to vm_unacct_memory the charge already accumulated.

Hugh



This archive was generated by hypermail 2.1.3 : Wed Feb 09 2005 - 13:47:42 PST