--------------------------------------------------------------->
vma = find_vma(current->mm, addr);
zap_page_range(current->mm, vma->vm_start, vma->vm_end);
zeromap_page_range(vma->vm_start, vma->vm_end - vma->vm_start,
PAGE_COPY);
<---------------------------------------------------------------
[the MMU and virtual cache flushes are left out for simplicity]
What i'm thinking about is to use 'read() on /dev/zero' as a 'fast zeroer'.
Thus we could simply zero out address ranges ... without the overhead of
first mmunmap()-ing the area then mmap()-ing /dev/zero. This would only be
for nonshared areas first, for simplicity.
Or is this already possible with mmap()? [sorry if i've missed something]
[ would still be a cool enough hack for me ... i usually wipe harddisks
with dd if=/dev/zero ... bs=somebignumber :) ]
-- mingo