Re: [PATCH v2] fadvise: move active pages to inactive list with POSIX_FADV_DONTNEED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 23, 2011 at 08:10:47AM -0400, Theodore Tso wrote:
> 
> On Jun 23, 2011, at 2:36 AM, Andrea Righi wrote:
> 
> > 
> > With the following solution when posix_fadvise(POSIX_FADV_DONTNEED) is
> > called for an active page instead of removing it from the page cache it
> > is added to the tail of the inactive list. Otherwise, if it's already in
> > the inactive list the page is removed from the page cache.
> 
> 
> Have you thought about this heuristic?   If the page is active, try to
> remove it from the current process's page table.  If that drops the
> use count of the page to zero, then drop it from the page cache;
> otherwise, leave it alone.
> 
> That way, if the page is being used by anyone else, we don't touch
> the page at all.   fadvise() should only affect the current process; if
> it's available to non-root users, it shouldn't be affecting other
> processes, and if it is being actively used by some other process,
> removing it from their page tables so it can be put on the inactive
> list counts as interference, doesn't it?

If the page is mapped in other process page tables we don't touch the
page at all (see lru_deactivate_fn in mm/swap.c).

So the heuristic above it's already implemented. I should have said this
explicitly in my description...

-Andrea

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]