Messages in this thread | | | Subject | Re: differences between MADV_FREE and MADV_DONTNEED | From | (Eric W. Biederman) | Date | Mon, 16 Jan 2006 14:43:47 -0700 |
| |
Andrea Arcangeli <andrea@suse.de> writes:
> On Mon, Jan 16, 2006 at 09:03:00AM -0800, Suleiman Souhlal wrote: >> Andrea Arcangeli wrote: >> >> >We can also use it for the same purpose, we could add the pages to >> >swapcache mark them dirty and zap the ptes _after_ that. >> >> Wouldn't that cause the pages to get swapped out immediately? > > Not really, it would be a non blocking operation. But they could be > swapped out shortly later (that's the whole point of DONTNEED, right?), > once there is more memory pressure. Otherwise if they're used again, a > minor fault will happen and it will find the swapcache uptodate in ram.
As I recall the logic with DONTNEED was to mark the mapping of the page clean so the page didn't need to be swapped out, it could just be dropped.
That is why they anonymous and the file backed cases differ.
Part of the point is to avoid the case of swapping the pages out if the application doesn't care what is on them anymore.
Eric - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |