lkml.org 
[lkml]   [1997]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectfast 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


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.154 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site