Messages in this thread | | | Date | Thu, 16 Jan 1997 18:47:26 +0100 (MET) | From | Ingo Molnar <> | Subject | fast largearea zeroing with read()s on /dev/zero? |
| |
Is this a safe way to change a vma to a zeromap vma?:
---------------------------------------------------------------> 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
| |