Re: [RFC] /dev/anon

From: Davide Libenzi
Date: Tue Jan 13 2004 - 23:49:17 EST


On Tue, 13 Jan 2004, Jeff Dike wrote:

> On Tue, Jan 13, 2004 at 12:38:05PM -0800, Davide Libenzi wrote:
> > Now I'm going to say something really stupid, but why sys_madvise(MADV_DONTNEED)
> > won't work for this?
> >
>
> MADV_DONTNEED is fine for anonymous memory, but it can't make a filesystem
> throw out data, which is what I need. If it did, then people wouldn't be
> agitating for sys_punch.

What do you mean for throw out data? If you mean writing DONTNEED'ed
dirty pages to the backed up file and release them to the page cache, it
does. If you mean stop handling page faults inside the DONTNEED'ed region,
it does not. If you mean zero-filling (ala ftruncate()) the DONTNEED'ed
region, it obviously does not. I thought your goal was to release memory
to the host, that's why I proposed sys_madvise(MADV_DONTNEED).



- Davide




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/