-
Hugh Dickins authored
Repeated overnight kernel builds in tmpfs showed insane Committed_AS by morning. The main bug was that shmem_file_write was passing (newsize-oldsize)>>PAGE_SHIFT to vm_enough_memory, but it has to be ((newsize>>PAGE_SHIFT)-(oldsize>>PAGE_SHIFT)) - imagine 1k writes. But actually, if we're going to do strict accounting, then we should round up to next page not down - use VM_ACCT macro throughout (needs unusual mix of PAGE_CACHE_SIZE with PAGE_SHIFT); and must count one page for a long symlink.
477436ba